@buaa_smat/hometrans 26.0.2 → 26.0.4-devecocli.1
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/agents/code-reviewer.md +111 -154
- package/devecocli-plugin/common.ts +2271 -0
- package/devecocli-plugin/content-resolver.ts +363 -0
- package/devecocli-plugin/install.ts +72 -0
- package/devecocli-plugin/uninstall.ts +26 -0
- package/devecocli-plugin/update.ts +77 -0
- package/i18n/FILE-NAMES.md +9 -0
- package/i18n/agents/code-reviewer.md +436 -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 +206 -0
- package/i18n/skills/a2h-app-migrate/references/config.example.json +28 -0
- package/i18n/skills/a2h-app-migrate/references/feature-scope.md +121 -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 +2007 -0
- package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +187 -0
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1656 -0
- package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +728 -0
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +541 -0
- package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +143 -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 +713 -0
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +117 -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 +271 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +222 -0
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +136 -0
- package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +552 -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 +263 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +165 -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 +207 -0
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
- package/i18n/skills/a2h-arch-generate/SKILL.md +378 -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 +131 -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/SKILL.md +304 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +10 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +249 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +344 -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 +877 -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 +597 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +372 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +35 -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 +85 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +23 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +89 -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 +62 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +30 -0
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +930 -0
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +420 -0
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +158 -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 +2552 -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 +175 -0
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +251 -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 +232 -0
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +206 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +232 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +2005 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +2118 -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 +1805 -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 +1959 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -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 +1632 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1300 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +1234 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +417 -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 +216 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +615 -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 +49 -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/dialog_backboard.ts +91 -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/event_default_click.ts +179 -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/hit_test.ts +339 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +780 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +138 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +408 -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/overlay_binds.ts +56 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +179 -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 +81 -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/relative_container_height.ts +102 -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 +147 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/safe_area_clipping.ts +168 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +127 -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/swiper_index.ts +65 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +184 -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/waterflow_sections.ts +231 -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_input_runtime.test.mjs +514 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +651 -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_overlay_lottie.test.mjs +199 -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/branch_coverage.test.mjs +116 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +693 -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 +326 -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 +356 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +395 -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 +62 -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 +2050 -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 +265 -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 +239 -0
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +1174 -0
- package/i18n/skills/a2h-page-specgen/references/body-language.md +179 -0
- package/i18n/skills/a2h-page-specgen/references/gates.md +329 -0
- package/i18n/skills/a2h-page-specgen/references/page-inventory.md +220 -0
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +274 -0
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +210 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +1613 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +1650 -0
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +864 -0
- package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +346 -0
- package/i18n/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +155 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +684 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +252 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +864 -0
- package/i18n/skills/a2h-page-specgen/scripts/render.mjs +276 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +897 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +25 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +47 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +267 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +57 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +553 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +546 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +655 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1234 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +520 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1516 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +759 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +630 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +118 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +798 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +886 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +205 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1205 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +271 -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/uniapp-source/App.vue +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +1029 -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 +143 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +1121 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +188 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +549 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +368 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +348 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +250 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +776 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1103 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +240 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +427 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -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 +418 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1782 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +536 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +1239 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1801 -0
- package/i18n/skills/a2h-resource-convert/SKILL.md +375 -0
- package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +336 -0
- package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +272 -0
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +226 -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 +251 -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 +2596 -0
- package/i18n/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +238 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +358 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +307 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +103 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +266 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +71 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +55 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +246 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +752 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +661 -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 +126 -0
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +282 -0
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +908 -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/hybrid_route_cdp.mjs +376 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_b.mjs +550 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +647 -0
- package/i18n/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -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/diagnostics.test.mjs +252 -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/hybrid_route_identity.test.mjs +146 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +614 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +214 -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/seed_recipes.test.mjs +261 -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/diagnostics.mjs +196 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +1562 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +2714 -0
- package/i18n/skills/a2h-utg-static/SKILL.md +372 -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 +2190 -0
- package/i18n/skills/a2h-utg-static/scripts/audit.mjs +268 -0
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +720 -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/data_model.mjs +590 -0
- package/i18n/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/i18n/skills/a2h-utg-static/scripts/fragment_nav.mjs +1137 -0
- package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +705 -0
- package/i18n/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
- package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +958 -0
- package/i18n/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/i18n/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +545 -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 +125 -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_data_model.mjs +120 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +113 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_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_provenance.mjs +150 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +457 -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 +78 -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_routes.mjs +161 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +330 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -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 +1394 -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/index.js +1643 -0
- package/package.json +18 -168
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
- package/plugin.jsonc +12 -0
- package/skills/a2h-app-migrate/SKILL.md +31 -12
- package/skills/a2h-app-migrate/references/config.example.json +1 -0
- package/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +427 -103
- package/skills/a2h-app-migrate/scripts/android_index.mjs +35 -8
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +39 -1
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -6
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +144 -9
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +14 -1
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +46 -5
- package/skills/a2h-app-migrate/scripts/diagnose.mjs +162 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +178 -44
- package/skills/a2h-app-migrate/scripts/feature_scope.mjs +347 -0
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +81 -11
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +17 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +80 -10
- package/skills/a2h-app-migrate/scripts/migration_manifest.mjs +351 -0
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +9 -23
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +72 -12
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +33 -1
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +137 -41
- package/skills/a2h-app-migrate/scripts/scope_model.mjs +255 -0
- package/skills/a2h-app-migrate/scripts/scope_report.mjs +128 -0
- package/skills/a2h-app-migrate/scripts/source_fp.mjs +120 -0
- package/skills/a2h-app-migrate/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 +143 -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 +713 -0
- package/skills/a2h-app-migrate/test/test_feature_scope.mjs +217 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +117 -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_incremental_acceptance.mjs +145 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2.mjs +223 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2_acceptance.mjs +157 -0
- package/skills/a2h-app-migrate/test/test_incremental_profile.mjs +84 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +101 -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 +150 -0
- package/skills/a2h-app-migrate/test/test_migration_manifest.mjs +225 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +86 -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 +271 -0
- package/skills/a2h-app-migrate/test/test_resume_summary.mjs +222 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +136 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +552 -0
- package/skills/a2h-app-migrate/test/test_scope_model.mjs +172 -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 +155 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +263 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +165 -0
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +511 -0
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_capture_audit.mjs +106 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +65 -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 +214 -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 +20 -17
- 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 +25 -14
- package/skills/a2h-arch-generate/references/module-evidence-subagent.md +2 -2
- package/skills/a2h-arch-generate/references/source-baseline.md +4 -4
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +34 -3
- package/skills/a2h-arch-generate/scripts/create_project.mjs +24 -1
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +35 -46
- package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +29 -5
- 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 +208 -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 +164 -0
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +2 -5
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +163 -15
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +3 -1
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +120 -1
- package/skills/a2h-arkts-logic-coder/references/spec-design.md +46 -11
- 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 +873 -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 +596 -0
- package/skills/a2h-batch-ui-align/SKILL.md +78 -26
- package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +16 -2
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +6 -1
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
- package/skills/a2h-batch-ui-align/references/cards/resources.md +9 -3
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +27 -3
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
- package/skills/a2h-batch-ui-align/references/checker-rules.md +301 -13
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +53 -13
- package/skills/a2h-batch-ui-align/references/host-dispatch.md +2 -0
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +14 -9
- 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/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +30 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +25 -6
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +7 -2
- package/skills/a2h-batch-ui-align/references/step5-convert.md +33 -9
- package/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +6 -7
- package/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +463 -22
- package/skills/a2h-batch-ui-align/scripts/capture_audit.mjs +474 -0
- package/skills/a2h-batch-ui-align/scripts/capture_fast.mjs +665 -0
- package/skills/a2h-batch-ui-align/scripts/capture_verify.mjs +552 -0
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +5 -2
- package/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
- package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +263 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +20 -3
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +4 -5
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +220 -35
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +517 -41
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/skills/a2h-batch-ui-align/scripts/image_probe.mjs +231 -54
- package/skills/a2h-batch-ui-align/scripts/list_existing.mjs +141 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +239 -14
- package/skills/a2h-batch-ui-align/scripts/page_gap.mjs +210 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +98 -11
- package/skills/a2h-batch-ui-align/scripts/progress_identity.mjs +208 -0
- package/skills/a2h-batch-ui-align/scripts/scroll_verdict.mjs +62 -0
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +118 -4
- package/skills/a2h-batch-ui-align/scripts/shell_requests.mjs +273 -0
- package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/baseline.ts +79 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +1 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +90 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +44 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +61 -12
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +32 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +3 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/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/dialog_backboard.ts +91 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/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/hit_test.ts +339 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +110 -12
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +179 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +81 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +184 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +2 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +30 -2
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +231 -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_baseline.test.mjs +129 -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_coolmall_runtime2.test.mjs +697 -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_hit_test.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +651 -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_overlay_lottie.test.mjs +199 -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 +269 -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_runtime_api.test.mjs +346 -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_theme_runtime.test.mjs +95 -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/branch_coverage.test.mjs +116 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +693 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +291 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_audit.test.mjs +179 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_fast.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_gate.test.mjs +197 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_review_fixes.test.mjs +322 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +93 -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 +435 -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/fixtures/icon_drift_search_sheet/SearchMenuDialog.buggy.ets +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/meta.json +21 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/screenshot.png +0 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/view.xml +35 -0
- package/skills/a2h-batch-ui-align/scripts/tests/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_pack_evidence.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +1782 -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/icon_coverage.test.mjs +314 -0
- package/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
- package/skills/a2h-batch-ui-align/scripts/tests/list_existing.test.mjs +157 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +326 -0
- package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/skills/a2h-batch-ui-align/scripts/tests/page_gap.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +356 -0
- package/skills/a2h-batch-ui-align/scripts/tests/progress_identity.test.mjs +174 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +302 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_requests.test.mjs +158 -0
- package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +60 -0
- package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +395 -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-coldstart-smoke-gate/SKILL.md +7 -4
- 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_device_locale_dialogs.mjs +17 -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/SKILL.md +51 -13
- package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +66 -11
- 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_incremental_fingerprint.mjs +94 -0
- package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/skills/a2h-page-specgen/SKILL.md +240 -0
- package/skills/a2h-page-specgen/references/behavior-ledger.md +1170 -0
- package/skills/a2h-page-specgen/references/body-language.md +179 -0
- package/skills/a2h-page-specgen/references/evidence.md +105 -0
- package/skills/a2h-page-specgen/references/execution-model.md +364 -0
- package/skills/a2h-page-specgen/references/footprint-and-grouping.md +255 -0
- package/skills/a2h-page-specgen/references/gates.md +323 -0
- package/skills/a2h-page-specgen/references/page-inventory.md +220 -0
- package/skills/a2h-page-specgen/references/scenario-authoring.md +272 -0
- package/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/skills/a2h-page-specgen/references/spec-template.md +210 -0
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/skills/a2h-page-specgen/scripts/dispatch.mjs +212 -0
- package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/skills/a2h-page-specgen/scripts/facts-build.mjs +1613 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +825 -0
- package/skills/a2h-page-specgen/scripts/footprint.mjs +1650 -0
- package/skills/a2h-page-specgen/scripts/gate.mjs +848 -0
- package/skills/a2h-page-specgen/scripts/interactions.mjs +344 -0
- package/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +155 -0
- package/skills/a2h-page-specgen/scripts/lib/deps-source.mjs +399 -0
- package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +229 -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/graph-evidence.mjs +235 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +683 -0
- package/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +478 -0
- package/skills/a2h-page-specgen/scripts/lib/main-module.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/skills/a2h-page-specgen/scripts/lib/prose.mjs +238 -0
- package/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/skills/a2h-page-specgen/scripts/lib/recovery-policy.mjs +28 -0
- package/skills/a2h-page-specgen/scripts/lib/scope.mjs +355 -0
- package/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -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/operation-evidence.mjs +1542 -0
- package/skills/a2h-page-specgen/scripts/prepare.mjs +840 -0
- package/skills/a2h-page-specgen/scripts/render.mjs +294 -0
- package/skills/a2h-page-specgen/scripts/report.mjs +340 -0
- package/skills/a2h-page-specgen/scripts/submission.mjs +697 -0
- package/skills/a2h-page-specgen/scripts/submit.mjs +85 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/README.md +77 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +871 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.java +15 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +26 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.java +36 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +43 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +265 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.java +47 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +54 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +515 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/cases.example.json +57 -0
- package/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +543 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +652 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1231 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +494 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1513 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +758 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +623 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +116 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +795 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +883 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +205 -0
- package/skills/a2h-page-specgen/scripts/test/dispatch.test.mjs +258 -0
- package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1203 -0
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +243 -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 +112 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.java +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.kt +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanelsKotlinForms.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ChildContent.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ComposeLifecycle.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleCallAndOverride.java +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleHooks.kt +31 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/MainFragment.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyLifecycleHooks.kt +12 -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/src/RefreshOnResume.java +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshResultNoise.kt +36 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/SelectionView.java +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ShowPage.vue +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ThirdPartyLifecycle.kt +25 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/fragment_detail.xml +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/skills/a2h-page-specgen/scripts/test/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 +1029 -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 +143 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +1078 -0
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/skills/a2h-page-specgen/scripts/test/helpers.mjs +188 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +549 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +368 -0
- package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +310 -0
- package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +250 -0
- package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +776 -0
- package/skills/a2h-page-specgen/scripts/test/ledger-lock.test.mjs +77 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +464 -0
- package/skills/a2h-page-specgen/scripts/test/main-module.test.mjs +43 -0
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1103 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +160 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +236 -0
- package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +398 -0
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
- package/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +418 -0
- package/skills/a2h-page-specgen/scripts/test/recovery-policy.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1782 -0
- package/skills/a2h-page-specgen/scripts/test/render.test.mjs +546 -0
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +296 -0
- package/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/skills/a2h-page-specgen/scripts/test/scope.test.mjs +292 -0
- package/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/skills/a2h-page-specgen/scripts/test/source-text.test.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +1231 -0
- package/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/skills/a2h-page-specgen/scripts/test/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 +1801 -0
- package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +1993 -0
- package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +342 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +1301 -0
- package/skills/a2h-page-specgen/scripts/watchdog.mjs +299 -0
- package/skills/a2h-resource-convert/SKILL.md +9 -1
- package/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
- package/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
- package/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +115 -53
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +68 -0
- package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +45 -3
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +42 -5
- package/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/skills/a2h-resource-convert/scripts/lottie_refs.ts +398 -0
- package/skills/a2h-resource-convert/scripts/merge_mapping.ts +316 -0
- package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +2 -1
- package/skills/a2h-resource-convert/scripts/tests/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/code_vector_guard.test.mjs +75 -0
- package/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_incremental.test.mjs +178 -0
- package/skills/a2h-resource-convert/scripts/tests/merge_mapping.test.mjs +201 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +98 -121
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +170 -45
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +62 -12
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -4
- package/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +229 -0
- package/skills/a2h-spec-design-pipeline/references/initialization.md +49 -6
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +198 -54
- package/skills/a2h-spec-design-pipeline/references/permission-index.json +206 -0
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +67 -0
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +46 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +47 -14
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +390 -0
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +148 -29
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +104 -24
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +18 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +16 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +47 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +31 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +698 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +96 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +103 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +124 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +138 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +106 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +113 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +705 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +1063 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +473 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/platform/ExtraDataSubCheck.js +485 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +13 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +18 -0
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +12 -38
- package/skills/a2h-spec-design-pipeline/scripts/check_design_map.ts +108 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_permissions.ts +420 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_review_evidence.ts +45 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +95 -7
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +156 -7
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +71 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +22 -3
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +63 -4
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +33 -3
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/worktree.mjs +2 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +232 -13
- package/skills/a2h-spec-design-pipeline/scripts/ensure_index.ts +866 -0
- package/skills/a2h-spec-design-pipeline/scripts/fixtures/homecheck-stub.cjs +47 -0
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +220 -44
- 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 +178 -14
- package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +3 -0
- package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +368 -0
- package/skills/a2h-spec-design-pipeline/scripts/scan_shared.ts +642 -0
- package/skills/a2h-spec-design-pipeline/scripts/sync_permission_index.ts +340 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +281 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +690 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_design_map.ts +46 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_permissions.ts +201 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +42 -8
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +27 -9
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +242 -9
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +192 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +531 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +49 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +92 -4
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +51 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index.ts +572 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index_real.ts +56 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +17 -10
- package/skills/a2h-spec-design-pipeline/scripts/test_homegraph_docs.ts +217 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_permission_index.ts +214 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +308 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +14 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +401 -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 +165 -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 +89 -23
- 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/specs.schema.json +24 -11
- 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/ensure-index.mjs +1 -2
- 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 +229 -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/SKILL.md +9 -3
- package/skills/a2h-utg-explorer/references/architecture.md +7 -0
- package/skills/a2h-utg-explorer/scripts/audit.mjs +8 -2
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +120 -85
- package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +47 -2
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +1 -2
- package/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +8 -0
- package/skills/a2h-utg-explorer/scripts/recover.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +5 -3
- package/skills/a2h-utg-explorer/scripts/report.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +67 -10
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +10 -2
- package/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/tests/blank_wait.test.mjs +126 -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/default_override.test.mjs +109 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +160 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_locale_dialogs.test.mjs +29 -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/diagnostics.test.mjs +254 -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/foreground_spelling.test.mjs +155 -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/hybrid_route.test.mjs +120 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +614 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +214 -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/pr169_review_fixes.test.mjs +218 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +292 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover.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/recover_d_grounding.test.mjs +164 -0
- package/skills/a2h-utg-explorer/scripts/tests/replay_reroute.test.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/tests/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 +458 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle_follow.test.mjs +35 -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/seed_recipes.test.mjs +261 -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 +135 -7
- package/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +245 -69
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +164 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +718 -42
- package/skills/a2h-utg-explorer/scripts/variant.mjs +57 -11
- package/skills/a2h-utg-static/SKILL.md +6 -2
- package/skills/a2h-utg-static/scripts/assemble.mjs +93 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +135 -25
- package/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +110 -3
- package/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
- package/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
- package/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +2 -3
- package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +46 -1
- package/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
- package/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/skills/a2h-utg-static/scripts/menu_nav.mjs +1 -1
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +34 -7
- 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/run_pipeline.mjs +86 -4
- 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_carry_answers.mjs +30 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +18 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +114 -0
- package/skills/a2h-utg-static/scripts/tests/test_guard_kinds_locale.mjs +12 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +165 -1
- package/skills/a2h-utg-static/scripts/tests/test_library_activity.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +38 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_default_override.mjs +50 -0
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +21 -0
- package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_redirect_path_cost.mjs +136 -0
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +29 -1
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_route_jump.mjs +175 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +99 -0
- package/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +21 -0
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +112 -69
- package/skills/a2h-utg-static/scripts/vm_nav.mjs +9 -1
- package/README.md +0 -439
- package/dist/cli/config-store.js +0 -128
- package/dist/cli/config.js +0 -48
- package/dist/cli/editors.json +0 -114
- package/dist/cli/env-vars.js +0 -127
- package/dist/cli/index.js +0 -73
- package/dist/cli/init.js +0 -2513
- package/dist/cli/uninstall.js +0 -406
- package/dist/platform/compose.js +0 -228
- package/dist/platform/frontmatter.js +0 -151
- package/dist/platform/installer.js +0 -417
- package/dist/platform/registry.js +0 -337
- package/dist/platform/transform.js +0 -363
- package/dist/platform/types.js +0 -9
- package/dist/platform/validate.js +0 -152
- package/dist/utils/regex.js +0 -7
- package/env-requirements.json +0 -511
- package/resource/choose_editor.png +0 -0
- package/resource/convert_pipeline_process.svg +0 -114
- package/resource/project_architecture.svg +0 -120
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/resource/set_sdk.png +0 -0
- package/resource/title_dark.png +0 -0
- 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/ensure_wt_index.ts +0 -885
- 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_ensure_wt_index.ts +0 -856
- package/skills/a2h-spec-design-pipeline/scripts/test_i18n_term.ts +0 -70
- package/skills/a2h-spec-generate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-generate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.mjs +0 -54
- package/skills/a2h-utg-explorer/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-utg-explorer/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-utg-static/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-utg-static/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-utg-static/scripts/tests/test_i18n_term.mjs +0 -155
|
@@ -0,0 +1,1613 @@
|
|
|
1
|
+
// facts-build.mjs — the app-wide fact base every drafting agent reads.
|
|
2
|
+
//
|
|
3
|
+
// One build, reused by every page spec. Six fact files under `<outDir>/facts/`, plus
|
|
4
|
+
// `unknowns.json` when a fact family is partial:
|
|
5
|
+
// entities.json Room @Entity / @Serializable / data class / wire .proto — source scan, not graph
|
|
6
|
+
// endpoints.json Retrofit / OkHttp call sites and query parameters / base URLs / .proto services /
|
|
7
|
+
// uni.request wrappers
|
|
8
|
+
// stores.json DataStore / SharedPreferences / MMKV keys, `res/xml` preference screens (a
|
|
9
|
+
// ListPreference's key, default and COMPLETE value enumeration), and uni storage
|
|
10
|
+
// strings.json res/values*/strings.xml and i18n/*.js — key -> per-column copy. A column is
|
|
11
|
+
// a language (`default`, `zh`) or a configuration variant of one
|
|
12
|
+
// (`default-night`, `zh-rCN-night`); see `stringsColumn` for the rule
|
|
13
|
+
// symbols.json project symbol table (G3 reads it back through lib/symbols.mjs)
|
|
14
|
+
// libs.json coordinates -> local sources.jar / node_modules path, plus the
|
|
15
|
+
// `library_unavailable` count of coordinates that resolved to null
|
|
16
|
+
//
|
|
17
|
+
// Every list is sorted so two runs over the same tree produce byte-identical files: the fact
|
|
18
|
+
// base is an input to dispatch, and unstable input makes a gate failure impossible to reproduce.
|
|
19
|
+
//
|
|
20
|
+
// Nothing here reads the homegraph DB or the network, and no AAR/jar is opened — see
|
|
21
|
+
// lib/deps-source.mjs for that boundary.
|
|
22
|
+
|
|
23
|
+
import fs from "node:fs";
|
|
24
|
+
import path from "node:path";
|
|
25
|
+
import { ensureDir, relPosix, writeJsonAtomic } from "./lib/fsx.mjs";
|
|
26
|
+
import { buildSymbolTable } from "./lib/symbols.mjs";
|
|
27
|
+
import { resolveLibSources } from "./lib/deps-source.mjs";
|
|
28
|
+
import { stripJsComments, stripSourceComments } from "./lib/source-text.mjs";
|
|
29
|
+
|
|
30
|
+
const SKIP_DIRS = new Set([
|
|
31
|
+
".git", ".gradle", ".homegraph", ".idea", "build", "dist", "node_modules",
|
|
32
|
+
"out", "target", "unpackage", "test", "tests", "androidTest", "coverage",
|
|
33
|
+
"generated", "uni_modules",
|
|
34
|
+
// A uni-app project ships its COMPILED bundle inside the Android shell:
|
|
35
|
+
// `android/simpleDemo/src/main/assets/apps/__UNI__FA6FEA4/www/app-service.js`.
|
|
36
|
+
// Generated runtime code is excluded; `__UNI__*` is the HBuilderX marker for this directory.
|
|
37
|
+
"www",
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
const EXCLUDED_EVIDENCE_DIRS = new Set([
|
|
41
|
+
"dist", "generated", "node_modules", "uni_modules", "unpackage", "www",
|
|
42
|
+
]);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* One path exclusion rule for facts, graph discovery, footprints, and behavior evidence.
|
|
46
|
+
* Both separators and `./` are normalized before testing complete path segments.
|
|
47
|
+
*/
|
|
48
|
+
export function isExcludedEvidencePath(file) {
|
|
49
|
+
if (typeof file !== "string" || file.trim() === "") return false;
|
|
50
|
+
const normalized = path.posix.normalize(file.replace(/\\/g, "/")).replace(/^\.\//, "");
|
|
51
|
+
const segments = normalized.split("/").filter(segment => segment !== "" && segment !== ".");
|
|
52
|
+
if (segments.some(segment => EXCLUDED_EVIDENCE_DIRS.has(segment))) return true;
|
|
53
|
+
if (segments.some(segment => /uni-app-view|uni-jsframework|__uniapp|vite\.config/.test(segment))) return true;
|
|
54
|
+
if (segments.includes("assets") && segments.includes("apps")) return true;
|
|
55
|
+
if (segments.includes("build") && segments.includes("intermediates")) return true;
|
|
56
|
+
const basename = segments.at(-1) ?? "";
|
|
57
|
+
return /(?:^|[._-])(?:generated|gen)(?:[._-]|$)/i.test(basename);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const JVM_RE = /\.(?:kt|java)$/i;
|
|
61
|
+
const PROTO_RE = /\.proto$/i;
|
|
62
|
+
const SYMBOL_RE = /\.(?:kt|java|js|mjs|cjs|ts|tsx|vue)$/i;
|
|
63
|
+
/**
|
|
64
|
+
* Files a non-JVM scanner may read. Deliberately narrower than {@link SYMBOL_RE}: that one also
|
|
65
|
+
* admits `.tsx`/`.mjs`, and scanning those for `uni.*` calls would read tooling scripts a project
|
|
66
|
+
* happens to ship. A uni-app page or service is `.js` / `.ts` / `.vue`.
|
|
67
|
+
*/
|
|
68
|
+
const UI_SOURCE_RE = /\.(?:js|ts|vue)$/i;
|
|
69
|
+
// The qualifier class admits `+` because a BCP-47 directory is written `values-b+zh+Hans`.
|
|
70
|
+
const STRINGS_RE = /(?:^|\/)res\/values(?:-([A-Za-z0-9_+-]+))?\/strings\.xml$/;
|
|
71
|
+
/**
|
|
72
|
+
* moko-resources (Kotlin Multiplatform) keeps its copy in `moko-resources/<lang>/strings.xml`,
|
|
73
|
+
* with `base` as the default directory instead of `values`.
|
|
74
|
+
*
|
|
75
|
+
* The directory name IS the language here: there are no `-night` / `-land` configuration
|
|
76
|
+
* variants in this layout, so {@link stringsColumn} must NOT be applied. That function requires
|
|
77
|
+
* a two-letter code and must not file other language codes under `default`.
|
|
78
|
+
*/
|
|
79
|
+
const MOKO_STRINGS_RE = /(?:^|\/)moko-resources\/([A-Za-z][A-Za-z0-9_+-]*)\/strings\.xml$/;
|
|
80
|
+
const I18N_RE = /(?:^|\/)i18n\/([A-Za-z][A-Za-z0-9_-]*)\.(?:js|mjs|cjs|ts)$/;
|
|
81
|
+
// A preference screen (`res/xml/*.xml`) declares a setting's key, default and — through
|
|
82
|
+
// `app:entries` / `app:entryValues` — the COMPLETE enumeration of a ListPreference. These values
|
|
83
|
+
// must be collected from XML as well as source code.
|
|
84
|
+
const PREF_XML_RE = /(?:^|\/)res\/xml\/[^/]+\.xml$/;
|
|
85
|
+
const ARRAYS_XML_RE = /(?:^|\/)res\/values(?:-([A-Za-z0-9_+-]+))?\/arrays\.xml$/;
|
|
86
|
+
|
|
87
|
+
const MAX_DEPTH = 24;
|
|
88
|
+
|
|
89
|
+
/** Every regular file under `root` as POSIX paths relative to it, sorted. */
|
|
90
|
+
function walk(root) {
|
|
91
|
+
const out = [];
|
|
92
|
+
const visit = (dir, depth) => {
|
|
93
|
+
if (depth > MAX_DEPTH) return;
|
|
94
|
+
let entries;
|
|
95
|
+
try {
|
|
96
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
97
|
+
} catch {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
for (const entry of entries) {
|
|
101
|
+
const abs = path.join(dir, entry.name);
|
|
102
|
+
if (entry.isDirectory()) {
|
|
103
|
+
if (!SKIP_DIRS.has(entry.name)) visit(abs, depth + 1);
|
|
104
|
+
} else if (entry.isFile()) {
|
|
105
|
+
out.push(abs);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
visit(root, 0);
|
|
110
|
+
return out.sort();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function readText(file) {
|
|
114
|
+
try {
|
|
115
|
+
return fs.readFileSync(file, "utf8").replace(/^/, "");
|
|
116
|
+
} catch {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const stripJvmComments = (text) => stripSourceComments(text);
|
|
122
|
+
|
|
123
|
+
// ---------------------------------------------------------------------------
|
|
124
|
+
// same-file constants
|
|
125
|
+
// ---------------------------------------------------------------------------
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* A literal stored in a same-file constant is still a literal, and real code never repeats it:
|
|
129
|
+
*
|
|
130
|
+
* static final String PREF_KEY_LANGUAGE = "languagePrefs"; // used via the constant name
|
|
131
|
+
* const STORAGE_KEY = 'weatherapp_data' // same for a JS declaration
|
|
132
|
+
*
|
|
133
|
+
* SCOPE: same file only. A cross-file constant needs an import resolver, and picking one of several
|
|
134
|
+
* same-named constants is exactly the invention this module forbids. A name that does not resolve
|
|
135
|
+
* in this file is left unresolved — never guessed.
|
|
136
|
+
*
|
|
137
|
+
* The map is literal -> literal. It can rewrite a name into a string that appears in the file that
|
|
138
|
+
* declared it and cannot produce a string that appears nowhere.
|
|
139
|
+
*/
|
|
140
|
+
const JVM_CONST_RE = /\b(?:static[ \t]+final|final[ \t]+static)[ \t]+(?:[A-Za-z_][\w.<>?,[\] ]*?[ \t]+)?([A-Za-z_]\w*)[ \t]*=[ \t]*"([^"]*)"/g;
|
|
141
|
+
const KT_CONST_RE = /\bconst[ \t]+val[ \t]+([A-Za-z_]\w*)[ \t]*(?::[ \t]*[A-Za-z_][\w.<>?,[\]]*[ \t]*)?=[ \t]*"([^"]*)"/g;
|
|
142
|
+
const JS_CONST_RE = /\b(?:export[ \t]+)?const[ \t]+([A-Za-z_$][\w$]*)[ \t]*=[ \t]*(["'])((?:\\.|(?!\2)[^\\])*)\2/g;
|
|
143
|
+
/**
|
|
144
|
+
* Kotlin/JVM constant whose value is a string-concatenation expression, not a bare literal.
|
|
145
|
+
* Captures: 1 = name, 2 = the raw expression (e.g. `BASE + "register"`).
|
|
146
|
+
*
|
|
147
|
+
* WHY: `evalRetrofitPath` resolves the path in a Retrofit annotation by looking up each piece
|
|
148
|
+
* in the constants map. When the annotation says `@GET(NetworkConstants.URI_REGISTER)` and
|
|
149
|
+
* `URI_REGISTER = BASE + "register"`, the map must hold `URI_REGISTER -> "BASE + \"register\""`
|
|
150
|
+
* (the expression text) so `evalRetrofitPath` can recurse through it. Without this regex the map
|
|
151
|
+
* only holds bare literals, `URI_REGISTER` comes back null, and the endpoint path is dropped.
|
|
152
|
+
*
|
|
153
|
+
* The pattern ends at the first newline or `;` to avoid swallowing unrelated code.
|
|
154
|
+
*/
|
|
155
|
+
const KT_CONST_EXPR_RE = /\bconst[ \t]+val[ \t]+([A-Za-z_]\w*)[ \t]*(?::[ \t]*[A-Za-z_][\w.<>?,[\]]*[ \t]*)?=[ \t]*([^"\n;][^\n;]*)/g;
|
|
156
|
+
const JVM_CONST_EXPR_RE = /\b(?:static[ \t]+final|final[ \t]+static)[ \t]+(?:[A-Za-z_][\w.<>?,[\] ]*?[ \t]+)?([A-Za-z_]\w*)[ \t]*=[ \t]*([^"\n;][^\n;]*)/g;
|
|
157
|
+
|
|
158
|
+
/** name -> literal value (or raw expression for concat-consts), from whichever constant syntaxes `text` uses. */
|
|
159
|
+
function scanConstants(text, rel) {
|
|
160
|
+
const out = new Map();
|
|
161
|
+
const jvm = JVM_RE.test(rel);
|
|
162
|
+
const cleaned = jvm ? stripJvmComments(text) : stripJsComments(text);
|
|
163
|
+
for (const m of cleaned.matchAll(JVM_CONST_RE)) out.set(m[1], m[2]);
|
|
164
|
+
for (const m of cleaned.matchAll(KT_CONST_RE)) out.set(m[1], m[2]);
|
|
165
|
+
// A `.kt` file can also hold JS-shaped syntax inside a string, but the reverse (`const` in a
|
|
166
|
+
// `.js`) is the only case that matters; running both is harmless and the JVM form wins ties.
|
|
167
|
+
for (const m of cleaned.matchAll(JS_CONST_RE)) {
|
|
168
|
+
if (!out.has(m[1])) out.set(m[1], m[3].replace(/\\(['"`\\])/g, "$1"));
|
|
169
|
+
}
|
|
170
|
+
// Concat-constant expressions for JVM/Kotlin: store the raw expression so evalRetrofitPath can
|
|
171
|
+
// recurse through it (e.g. `URI_REGISTER = BASE + "register"` → map holds the expression).
|
|
172
|
+
// Only add if not already present as a bare literal (bare literal wins).
|
|
173
|
+
if (jvm) {
|
|
174
|
+
for (const m of cleaned.matchAll(KT_CONST_EXPR_RE)) {
|
|
175
|
+
if (!out.has(m[1])) out.set(m[1], m[2].trim());
|
|
176
|
+
}
|
|
177
|
+
for (const m of cleaned.matchAll(JVM_CONST_EXPR_RE)) {
|
|
178
|
+
if (!out.has(m[1])) out.set(m[1], m[2].trim());
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return out;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** `name` resolved through `consts`, or null. Never invents: an unknown name stays null. */
|
|
185
|
+
const resolveConst = (name, consts) => {
|
|
186
|
+
if (name === undefined || name === null) return null;
|
|
187
|
+
const hit = consts instanceof Map ? consts.get(name) : undefined;
|
|
188
|
+
return hit === undefined ? null : hit;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
/** Split `text` on top-level `sep`, ignoring separators inside `<>()[]{}` or quotes. */
|
|
192
|
+
function splitTopLevel(text, sep) {
|
|
193
|
+
const out = [];
|
|
194
|
+
let depth = 0;
|
|
195
|
+
let quote = null;
|
|
196
|
+
let current = "";
|
|
197
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
198
|
+
const ch = text[i];
|
|
199
|
+
if (quote !== null) {
|
|
200
|
+
current += ch;
|
|
201
|
+
if (ch === "\\") { current += text[i + 1] ?? ""; i += 1; continue; }
|
|
202
|
+
if (ch === quote) quote = null;
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (ch === '"' || ch === "'" || ch === "`") { quote = ch; current += ch; continue; }
|
|
206
|
+
if ("<([{".includes(ch)) depth += 1;
|
|
207
|
+
if (">)]}".includes(ch)) depth -= 1;
|
|
208
|
+
if (ch === sep && depth <= 0) { out.push(current); current = ""; continue; }
|
|
209
|
+
current += ch;
|
|
210
|
+
}
|
|
211
|
+
out.push(current);
|
|
212
|
+
return out;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// ---------------------------------------------------------------------------
|
|
216
|
+
// entities
|
|
217
|
+
// ---------------------------------------------------------------------------
|
|
218
|
+
|
|
219
|
+
const JVM_CLASS_RE = /((?:^[ \t]*@\w+(?:\([^\n)]*\))?[ \t]*\r?\n)*)^[ \t]*(?:data[ \t]+)?class[ \t]+([A-Za-z_]\w*)[ \t]*(\(([\s\S]*?)\))?[ \t]*(?:\{|:|$)/gm;
|
|
220
|
+
const JVM_FIELD_RE = /(?:^|\s)(?:val|var)\s+([A-Za-z_]\w*)\s*:\s*([A-Za-z_][\w.<>?, ]*?)\s*(?:=|$)/;
|
|
221
|
+
|
|
222
|
+
/** `fields[]` of a JVM primary constructor / body. */
|
|
223
|
+
function jvmFields(params) {
|
|
224
|
+
const fields = [];
|
|
225
|
+
for (const raw of splitTopLevel(params, ",")) {
|
|
226
|
+
const m = JVM_FIELD_RE.exec(raw);
|
|
227
|
+
if (m === null) continue;
|
|
228
|
+
const type = m[2].trim();
|
|
229
|
+
fields.push({ name: m[1], type, nullable: type.endsWith("?") });
|
|
230
|
+
}
|
|
231
|
+
return fields;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Collect Room DAO operations from a comment-stripped JVM source. Returns a map from entity
|
|
236
|
+
* type name → operation list. Called only when `@Dao` is present in the file.
|
|
237
|
+
*
|
|
238
|
+
* Entity matching: return type takes priority, first parameter type is the fallback for void/Unit
|
|
239
|
+
* operations like `@Insert`/`@Update`/`@Delete`. `Unit`, `void`, `Boolean`, `Long`, `Int`, and
|
|
240
|
+
* `List` are never matched as entity names — they are primitive or generic wrapper types.
|
|
241
|
+
*
|
|
242
|
+
* @param {string} cleaned - comment-stripped source text
|
|
243
|
+
* @returns {Map<string, Array<{method: string, function: string}>>}
|
|
244
|
+
*/
|
|
245
|
+
function scanDaoOperations(cleaned) {
|
|
246
|
+
const NOT_ENTITY = new Set(["Unit", "void", "Boolean", "Long", "Int", "Float", "Double",
|
|
247
|
+
"String", "List", "Flow", "LiveData", "PagingSource", "Cursor"]);
|
|
248
|
+
const ops = new Map();
|
|
249
|
+
const add = (entityName, op) => {
|
|
250
|
+
if (!entityName || NOT_ENTITY.has(entityName)) return;
|
|
251
|
+
if (!ops.has(entityName)) ops.set(entityName, []);
|
|
252
|
+
ops.get(entityName).push(op);
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
for (const m of cleaned.matchAll(DAO_QUERY_RE)) {
|
|
256
|
+
const sqlVerb = /^\s*(SELECT|INSERT|UPDATE|DELETE|WITH)\b/i.exec(m[1]);
|
|
257
|
+
const method = sqlVerb === null ? "QUERY" : sqlVerb[1].toUpperCase();
|
|
258
|
+
const returnType = innermostType(m[3] ?? "");
|
|
259
|
+
add(returnType, { method, function: m[2] });
|
|
260
|
+
}
|
|
261
|
+
for (const m of cleaned.matchAll(DAO_OP_RE)) {
|
|
262
|
+
const method = m[1].toUpperCase();
|
|
263
|
+
const paramType = innermostType(m[3] ?? "");
|
|
264
|
+
add(paramType, { method, function: m[2] });
|
|
265
|
+
}
|
|
266
|
+
return ops;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function scanJvmEntities(text, rel) {
|
|
270
|
+
const cleaned = stripJvmComments(text);
|
|
271
|
+
const out = [];
|
|
272
|
+
|
|
273
|
+
// Collect DAO operations up front when this file is a DAO file. They get attached to the
|
|
274
|
+
// matching entity below, or — when the entity is declared in another file — they produce a
|
|
275
|
+
// placeholder entity so the operations are not silently lost.
|
|
276
|
+
const daoOps = cleaned.includes("@Dao") ? scanDaoOperations(cleaned) : new Map();
|
|
277
|
+
|
|
278
|
+
for (const m of cleaned.matchAll(JVM_CLASS_RE)) {
|
|
279
|
+
const annotations = (m[1] ?? "").match(/@\w+/g) ?? [];
|
|
280
|
+
// Room/Kotlin annotations may also sit inside the class body; the class-level ones are
|
|
281
|
+
// what name the entity kind, and they precede the declaration.
|
|
282
|
+
const kind = annotations.includes("@Entity") ? "room"
|
|
283
|
+
: annotations.includes("@Serializable") ? "serializable"
|
|
284
|
+
: m[0].includes("data class") ? "data-class" : null;
|
|
285
|
+
if (kind === null) continue;
|
|
286
|
+
const entry = { name: m[2], kind, file: rel, fields: jvmFields(m[4] ?? "") };
|
|
287
|
+
// Attach DAO operations when they reference this entity by name.
|
|
288
|
+
const ops = daoOps.get(m[2]);
|
|
289
|
+
if (ops !== undefined && ops.length > 0) {
|
|
290
|
+
entry.operations = ops;
|
|
291
|
+
daoOps.delete(m[2]); // consumed
|
|
292
|
+
}
|
|
293
|
+
out.push(entry);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Operations whose entity is declared in another file: emit a thin placeholder so the
|
|
297
|
+
// operation contract is not lost. Kind "room-dao-ref" signals that fields are unknown.
|
|
298
|
+
for (const [entityName, ops] of daoOps) {
|
|
299
|
+
if (ops.length === 0) continue;
|
|
300
|
+
out.push({ name: entityName, kind: "room-dao-ref", file: rel, fields: [], operations: ops });
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return out;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const PROTO_MESSAGE_RE = /^[ \t]*message[ \t]+([A-Za-z_]\w*)[ \t]*\{([\s\S]*?)^[ \t]*\}/gm;
|
|
307
|
+
const PROTO_FIELD_RE = /^[ \t]*(optional|required|repeated)?[ \t]*([A-Za-z_][\w.]*)[ \t]+([A-Za-z_]\w*)[ \t]*=[ \t]*(\d+)/gm;
|
|
308
|
+
|
|
309
|
+
function scanProtoEntities(text, rel) {
|
|
310
|
+
const out = [];
|
|
311
|
+
for (const m of String(text ?? "").matchAll(PROTO_MESSAGE_RE)) {
|
|
312
|
+
const fields = [];
|
|
313
|
+
for (const f of m[2].matchAll(PROTO_FIELD_RE)) {
|
|
314
|
+
fields.push({ name: f[3], type: f[2], repeated: f[1] === "repeated", nullable: f[1] === "optional" });
|
|
315
|
+
}
|
|
316
|
+
out.push({ name: m[1], kind: "proto", file: rel, fields });
|
|
317
|
+
}
|
|
318
|
+
return out;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// ---------------------------------------------------------------------------
|
|
322
|
+
// endpoints
|
|
323
|
+
// ---------------------------------------------------------------------------
|
|
324
|
+
|
|
325
|
+
const RETROFIT_RE = /@(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\(\s*["']([^"']*)["']\s*\)/g;
|
|
326
|
+
/**
|
|
327
|
+
* Extended Retrofit annotation that captures the ENTIRE argument expression rather than only a
|
|
328
|
+
* quoted literal. This covers `@GET(NetworkConstants.URI_R0 + "register")` and similar.
|
|
329
|
+
*
|
|
330
|
+
* The outer parentheses are NOT greedy-captured — they let the expression end naturally at `)`.
|
|
331
|
+
* The capture is the raw expression text: everything between `(` and `)`.
|
|
332
|
+
*/
|
|
333
|
+
const RETROFIT_EXPR_RE = /@(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\(\s*([^)]+?)\s*\)/g;
|
|
334
|
+
/**
|
|
335
|
+
* Bare annotation with no argument: `@GET` or `@POST` on its own line, path supplied at runtime
|
|
336
|
+
* via `@Url`. Group 1 is the method; there is no path.
|
|
337
|
+
*/
|
|
338
|
+
const RETROFIT_BARE_RE = /@(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s*\n/g;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Evaluate a Retrofit annotation path expression against a constants map.
|
|
342
|
+
*
|
|
343
|
+
* Handles three forms:
|
|
344
|
+
* 1. `"literal"` → the literal itself
|
|
345
|
+
* 2. `CONST` → looked up in `consts`
|
|
346
|
+
* 3. `CONST + "suffix"` / `"prefix" + CONST` / chains thereof → pieces joined
|
|
347
|
+
*
|
|
348
|
+
* Returns null when any piece is unresolvable — the path is then recorded as null (dynamic), not
|
|
349
|
+
* fabricated. "宁漏不编" applies to paths exactly as it does to storage keys.
|
|
350
|
+
*/
|
|
351
|
+
function evalRetrofitPath(expr, consts, _depth = 0) {
|
|
352
|
+
if (_depth > 8) return null; // guard against pathological chains
|
|
353
|
+
const s = String(expr ?? "").trim();
|
|
354
|
+
// Bare string literal: `"value"` or `'value'`
|
|
355
|
+
if (/^["'][^"']*["']$/.test(s)) return s.slice(1, -1);
|
|
356
|
+
// Already a resolved bare value (no quotes, no operators): treat as a literal.
|
|
357
|
+
// This case fires when we recursed into a consts entry that was already the resolved string
|
|
358
|
+
// (consts stores bare values, not quoted values, so "BASE" -> "_matrix/client/v3/" is bare).
|
|
359
|
+
if (!/\+/.test(s) && !/^[A-Za-z_$]/.test(s)) return s; // numeric or other bare literal
|
|
360
|
+
// Expression may be `PartA + PartB + ...`
|
|
361
|
+
const pieces = s.split(/\s*\+\s*/);
|
|
362
|
+
let result = "";
|
|
363
|
+
for (const piece of pieces) {
|
|
364
|
+
const p = piece.trim();
|
|
365
|
+
// Quoted string literal piece
|
|
366
|
+
if (/^["'].*["']$/.test(p)) { result += p.slice(1, -1); continue; }
|
|
367
|
+
// Identifier or qualified reference: look up in consts
|
|
368
|
+
if (/^[A-Za-z_$][\w$.]*$/.test(p)) {
|
|
369
|
+
const leaf = p.split(/[./]/).pop() ?? p;
|
|
370
|
+
const val = consts instanceof Map ? consts.get(leaf) : undefined;
|
|
371
|
+
if (val === undefined) return null; // unresolvable → return null
|
|
372
|
+
// The stored value may be a bare resolved string, a quoted literal, or a concat
|
|
373
|
+
// expression. Only wrap in quotes when it is a plain bare string (no leading quote,
|
|
374
|
+
// no '+'). An expression must be passed through as-is so the split logic above can
|
|
375
|
+
// handle it; wrapping an expression in quotes turns it into an invalid quoted literal.
|
|
376
|
+
const nextExpr =
|
|
377
|
+
/^["']/.test(val) || /\+/.test(val) ? val : `"${val.replace(/"/g, '\\"')}"`;
|
|
378
|
+
const resolved = evalRetrofitPath(nextExpr, consts, _depth + 1);
|
|
379
|
+
if (resolved === null) return null;
|
|
380
|
+
result += resolved;
|
|
381
|
+
continue;
|
|
382
|
+
}
|
|
383
|
+
// Anything else (method call, complex expression): cannot resolve
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
return result === "" ? null : result;
|
|
387
|
+
}
|
|
388
|
+
const HTTP_METHOD_OF = { GET: "GET", POST: "POST", PUT: "PUT", DELETE: "DELETE", PATCH: "PATCH", HEAD: "HEAD", OPTIONS: "OPTIONS" };
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Room DAO method annotations. A `@Dao`-annotated interface or abstract class holds the full
|
|
392
|
+
* data-access contract for an entity: what queries it runs, what mutations it offers. Without
|
|
393
|
+
* these the spec can name an entity (via `@Entity` in entities.json) but cannot say what the page
|
|
394
|
+
* does with it — a coder would have to invent the storage operations.
|
|
395
|
+
*
|
|
396
|
+
* Three forms:
|
|
397
|
+
* @Query("SELECT * FROM users WHERE id = :id")
|
|
398
|
+
* suspend fun getUserById(id: Int): User?
|
|
399
|
+
*
|
|
400
|
+
* @Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
401
|
+
* suspend fun insertUser(user: User)
|
|
402
|
+
*
|
|
403
|
+
* @Delete / @Update / @Upsert
|
|
404
|
+
* suspend fun deleteUser(user: User)
|
|
405
|
+
*
|
|
406
|
+
* The guard `text.includes("@Dao")` keeps this from running on every JVM file —
|
|
407
|
+
* DAO files are rare even in Room-heavy projects.
|
|
408
|
+
*
|
|
409
|
+
* @Query group order: 1 SQL text, 2 function name, 3 return type (after `:`).
|
|
410
|
+
* @Insert/@Update/@Delete/@Upsert group order: 1 annotation name, 2 function name,
|
|
411
|
+
* 3 first parameter type.
|
|
412
|
+
*
|
|
413
|
+
* Return-type capture: the SIGNATURE_RE already handles `fun name(...): ReturnType`, but we
|
|
414
|
+
* need just the return type here without parsing parameters. The pattern after the function name
|
|
415
|
+
* captures everything up to the first `{`, `=`, or newline — that covers `User?`, `List<User>`,
|
|
416
|
+
* `Flow<List<User>>`, and `Unit` (= no meaningful return). Unit / void is silently dropped.
|
|
417
|
+
*/
|
|
418
|
+
const DAO_QUERY_RE = /@Query\s*\(\s*["']([^"']*)["']\s*\)\s*(?:suspend\s+)?fun\s+([A-Za-z_]\w*)\s*\([^)]*\)\s*:\s*([A-Za-z_][\w<>?,. ]*?)(?:\s*[{=\n]|$)/gm;
|
|
419
|
+
const DAO_OP_RE = /@(Insert|Update|Delete|Upsert)\s*(?:\([^)]*\))?\s*(?:suspend\s+)?fun\s+([A-Za-z_]\w*)\s*\(\s*(?:[A-Za-z_]\w*\s*:\s*)?([A-Za-z_]\w*)/g;
|
|
420
|
+
|
|
421
|
+
/** Extract the innermost type name from a generic expression: `Flow<List<User?>>` → `User`. */
|
|
422
|
+
function innermostType(typeExpr) {
|
|
423
|
+
// Strip nullability and find last `<` contents recursively
|
|
424
|
+
let s = typeExpr.replace(/\?/g, "").trim();
|
|
425
|
+
const inner = s.match(/<(.+)>$/s);
|
|
426
|
+
if (inner) s = innermostType(inner[1]);
|
|
427
|
+
// Take the last dot-qualified segment
|
|
428
|
+
return s.split(".").pop()?.trim() ?? s;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
const PARAM_RE = /@(Query|Path|Body|Header|Field|QueryMap|FieldMap)\b(?:\(\s*["']([^"']*)["']\s*\))?\s*([A-Za-z_]\w*)\s*:\s*([^,)]+)/g;
|
|
432
|
+
const SIGNATURE_RE = /(?:suspend[ \t]+)?fun[ \t]+([A-Za-z_]\w*)[ \t]*\(([\s\S]*?)\)[ \t]*:[ \t]*([A-Za-z_][\w.<>?, ]*)/;
|
|
433
|
+
const BASE_URL_RE = /\b(?:BASE_URL|baseUrl|BASE_?URL)\b[^\n]*?["'](https?:\/\/[^"']*)["']/g;
|
|
434
|
+
const TIMEOUT_RE = /\.(connectTimeout|readTimeout|writeTimeout|callTimeout)\(\s*(\d+)\s*,\s*TimeUnit\.([A-Z_]+)\s*\)/g;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* OkHttp's imperative request builder:
|
|
438
|
+
*
|
|
439
|
+
* urlBuilder.addQueryParameter("latitude", String.valueOf(latitude))
|
|
440
|
+
* Request.Builder().url(url).method("GET", null)
|
|
441
|
+
*
|
|
442
|
+
* The parameter names are contract. The VALUES are not read: `String.valueOf(latitude)` is an
|
|
443
|
+
* argument whose runtime value the coder computes, and the literal ones (`"hpa"`, `"auto"`) are
|
|
444
|
+
* already recoverable from the code. Only the NAME is emitted, which is the thing that cannot be
|
|
445
|
+
* guessed.
|
|
446
|
+
*
|
|
447
|
+
* Group order: 1 name, 2 literal value.
|
|
448
|
+
*/
|
|
449
|
+
const QUERY_PARAM_RE = /\.addQueryParameter\(\s*"([^"]+)"\s*(?:,\s*([^)]*))?\)/g;
|
|
450
|
+
/**
|
|
451
|
+
* Deliberately NOT global. Every regex above is consumed with `matchAll`, which needs `g` and
|
|
452
|
+
* manages its own position; this one is consumed with `exec` against several slices of the same
|
|
453
|
+
* file, and a `g` flag would carry `lastIndex` from one chain into the next.
|
|
454
|
+
*/
|
|
455
|
+
const METHOD_CALL_RE = /\.method\(\s*"([A-Z]+)"\s*,\s*[^)]*\)/;
|
|
456
|
+
/** A `newBuilder()` on a URL variable opens a chain; the nearest preceding one owns it. */
|
|
457
|
+
const URL_BUILDER_RE = /([A-Za-z_$][\w$.]*)\s*=\s*[^\n;]*\.newBuilder\(\)/g;
|
|
458
|
+
|
|
459
|
+
function scanEndpoints(text, rel) {
|
|
460
|
+
const cleaned = stripJvmComments(text);
|
|
461
|
+
const consts = scanConstants(text, rel);
|
|
462
|
+
const out = [];
|
|
463
|
+
|
|
464
|
+
// Literal-path form: @GET("path") — handled by RETROFIT_RE as before.
|
|
465
|
+
for (const m of cleaned.matchAll(RETROFIT_RE)) {
|
|
466
|
+
const window = cleaned.slice(m.index + m[0].length, m.index + m[0].length + 600);
|
|
467
|
+
const sig = SIGNATURE_RE.exec(window);
|
|
468
|
+
const params = sig === null ? [] : [...sig[2].matchAll(PARAM_RE)].map((p) => ({
|
|
469
|
+
in: p[1] === "Query" || p[1] === "Path" || p[1] === "Header" || p[1] === "Field" ? p[1] : "body",
|
|
470
|
+
name: p[2] ?? null,
|
|
471
|
+
arg: p[3],
|
|
472
|
+
type: p[4].trim(),
|
|
473
|
+
}));
|
|
474
|
+
out.push({
|
|
475
|
+
file: rel,
|
|
476
|
+
protocol: "http",
|
|
477
|
+
method: HTTP_METHOD_OF[m[1]],
|
|
478
|
+
path: m[2],
|
|
479
|
+
function: sig === null ? null : sig[1],
|
|
480
|
+
request: params,
|
|
481
|
+
response: sig === null ? null : sig[3].trim(),
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Expression-path form: @GET(CONST + "suffix") — RETROFIT_EXPR_RE catches non-literal arguments.
|
|
486
|
+
// We skip entries already matched by RETROFIT_RE (their argument is a quoted literal, so
|
|
487
|
+
// RETROFIT_EXPR_RE would produce a duplicate); the distinct test is whether evalRetrofitPath
|
|
488
|
+
// returns something different from the literal that RETROFIT_RE already recorded.
|
|
489
|
+
const literalPaths = new Set(out.map((e) => e.path).filter((p) => p !== null));
|
|
490
|
+
for (const m of cleaned.matchAll(RETROFIT_EXPR_RE)) {
|
|
491
|
+
const expr = m[2].trim();
|
|
492
|
+
// Skip bare quoted literals — already handled by RETROFIT_RE above.
|
|
493
|
+
if (/^["'][^"']*["']$/.test(expr)) continue;
|
|
494
|
+
const resolved = evalRetrofitPath(expr, consts);
|
|
495
|
+
// Skip if the resolved path is the same as one already recorded (const == "literal" collapses).
|
|
496
|
+
if (resolved !== null && literalPaths.has(resolved)) continue;
|
|
497
|
+
const window = cleaned.slice(m.index + m[0].length, m.index + m[0].length + 600);
|
|
498
|
+
const sig = SIGNATURE_RE.exec(window);
|
|
499
|
+
const params = sig === null ? [] : [...sig[2].matchAll(PARAM_RE)].map((p) => ({
|
|
500
|
+
in: p[1] === "Query" || p[1] === "Path" || p[1] === "Header" || p[1] === "Field" ? p[1] : "body",
|
|
501
|
+
name: p[2] ?? null,
|
|
502
|
+
arg: p[3],
|
|
503
|
+
type: p[4].trim(),
|
|
504
|
+
}));
|
|
505
|
+
out.push({
|
|
506
|
+
file: rel,
|
|
507
|
+
protocol: "http",
|
|
508
|
+
method: HTTP_METHOD_OF[m[1]],
|
|
509
|
+
// null means "dynamic, could not be resolved" — correct and honest.
|
|
510
|
+
path: resolved,
|
|
511
|
+
function: sig === null ? null : sig[1],
|
|
512
|
+
request: params,
|
|
513
|
+
response: sig === null ? null : sig[3].trim(),
|
|
514
|
+
});
|
|
515
|
+
if (resolved !== null) literalPaths.add(resolved);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
// Bare-annotation form: @POST (no argument), path supplied via @Url at call time.
|
|
519
|
+
for (const m of cleaned.matchAll(RETROFIT_BARE_RE)) {
|
|
520
|
+
const window = cleaned.slice(m.index + m[0].length, m.index + m[0].length + 600);
|
|
521
|
+
const sig = SIGNATURE_RE.exec(window);
|
|
522
|
+
if (sig === null) continue;
|
|
523
|
+
const params = [...sig[2].matchAll(PARAM_RE)].map((p) => ({
|
|
524
|
+
in: p[1] === "Query" || p[1] === "Path" || p[1] === "Header" || p[1] === "Field" ? p[1] : "body",
|
|
525
|
+
name: p[2] ?? null,
|
|
526
|
+
arg: p[3],
|
|
527
|
+
type: p[4].trim(),
|
|
528
|
+
}));
|
|
529
|
+
out.push({
|
|
530
|
+
file: rel,
|
|
531
|
+
protocol: "http",
|
|
532
|
+
method: HTTP_METHOD_OF[m[1]],
|
|
533
|
+
path: null, // dynamic via @Url
|
|
534
|
+
function: sig[1],
|
|
535
|
+
request: params,
|
|
536
|
+
response: sig[3].trim(),
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
for (const m of cleaned.matchAll(BASE_URL_RE)) {
|
|
540
|
+
out.push({ file: rel, protocol: "http", method: null, path: null, base_url: m[1] });
|
|
541
|
+
}
|
|
542
|
+
for (const m of cleaned.matchAll(TIMEOUT_RE)) {
|
|
543
|
+
out.push({
|
|
544
|
+
file: rel, protocol: "http", method: null, path: null,
|
|
545
|
+
timeout: { name: m[1], value: Number(m[2]), unit: m[3] },
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
out.push(...scanOkHttpChains(cleaned, rel));
|
|
549
|
+
return out;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* One entry per OkHttp request chain, keyed on the `newBuilder()` that opens it.
|
|
554
|
+
*
|
|
555
|
+
* A segment runs from one `X = ….newBuilder()` to the next one (or end of file). Everything the
|
|
556
|
+
* chain adds — query parameters, the HTTP method — belongs to the request that builder produces.
|
|
557
|
+
* This is the only grouping this scanner asserts, and it is a real one: OkHttp's builder is
|
|
558
|
+
* mutable, so two chains sharing a variable are invalid source rather than a shape to support.
|
|
559
|
+
*
|
|
560
|
+
* A file with query parameters but no `newBuilder()` (an unusual wrapper) yields ONE ungrouped
|
|
561
|
+
* entry rather than being dropped — the parameter names are the contract, and the chain boundary
|
|
562
|
+
* is only used to decide which request they belong to.
|
|
563
|
+
*/
|
|
564
|
+
function scanOkHttpChains(cleaned, rel) {
|
|
565
|
+
if (!cleaned.includes("addQueryParameter") && !cleaned.includes(".method(")) return [];
|
|
566
|
+
const starts = [...cleaned.matchAll(URL_BUILDER_RE)].map((m) => ({ index: m.index, name: m[1] }));
|
|
567
|
+
const out = [];
|
|
568
|
+
if (starts.length === 0) {
|
|
569
|
+
const params = [...cleaned.matchAll(QUERY_PARAM_RE)].map((m) => ({ in: "query", name: m[1] }));
|
|
570
|
+
const method = METHOD_CALL_RE.exec(cleaned);
|
|
571
|
+
return params.length === 0 && method === null ? [] : [{
|
|
572
|
+
file: rel, protocol: "http", method: method === null ? null : method[1],
|
|
573
|
+
path: null, request: params,
|
|
574
|
+
}];
|
|
575
|
+
}
|
|
576
|
+
for (let i = 0; i < starts.length; i += 1) {
|
|
577
|
+
const from = starts[i].index;
|
|
578
|
+
const to = i + 1 < starts.length ? starts[i + 1].index : cleaned.length;
|
|
579
|
+
const segment = cleaned.slice(from, to);
|
|
580
|
+
const params = [...segment.matchAll(QUERY_PARAM_RE)].map((m) => ({
|
|
581
|
+
in: "query",
|
|
582
|
+
name: m[1],
|
|
583
|
+
// A literal argument is the value the request actually sends; a computed one is not knowable
|
|
584
|
+
// here, so the field is simply absent. `null` would claim "the value is null".
|
|
585
|
+
...(m[2] !== undefined && /^"[^"]*"$/.test(m[2].trim()) ? { value: m[2].trim().slice(1, -1) } : {}),
|
|
586
|
+
}));
|
|
587
|
+
const method = METHOD_CALL_RE.exec(segment);
|
|
588
|
+
if (params.length === 0 && method === null) continue;
|
|
589
|
+
out.push({
|
|
590
|
+
file: rel,
|
|
591
|
+
protocol: "http",
|
|
592
|
+
method: method === null ? null : method[1],
|
|
593
|
+
path: null,
|
|
594
|
+
builder: starts[i].name,
|
|
595
|
+
request: params,
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
return out;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
const PROTO_SERVICE_RE = /^[ \t]*service[ \t]+([A-Za-z_]\w*)[ \t]*\{([\s\S]*?)^[ \t]*\}/gm;
|
|
602
|
+
const PROTO_RPC_RE = /^[ \t]*rpc[ \t]+([A-Za-z_]\w*)[ \t]*\(\s*([\w.]+)\s*\)[ \t]*returns[ \t]*\(\s*([\w.]+)\s*\)/gm;
|
|
603
|
+
|
|
604
|
+
function scanProtoEndpoints(text, rel) {
|
|
605
|
+
const out = [];
|
|
606
|
+
for (const m of String(text ?? "").matchAll(PROTO_SERVICE_RE)) {
|
|
607
|
+
for (const rpc of m[2].matchAll(PROTO_RPC_RE)) {
|
|
608
|
+
out.push({
|
|
609
|
+
file: rel, protocol: "grpc", service: m[1], method: rpc[1],
|
|
610
|
+
path: null, request_type: rpc[2], response: rpc[3],
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return out;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Response type -> its entity's field names, so `endpoints.json` is readable on its own.
|
|
619
|
+
*
|
|
620
|
+
* RULE (stated because it is a choice, not an accident): when a response type names MORE THAN
|
|
621
|
+
* ONE project entity, the LAST one in the type expression wins. So `Pair<CityInfo, Forecast>`
|
|
622
|
+
* attaches `Forecast`'s fields, and `Response<List<CityInfo>>` attaches `CityInfo`'s. The
|
|
623
|
+
* rationale is that an entity named deepest/last in a wrapper is the payload the endpoint
|
|
624
|
+
* returns, while the earlier names are envelopes, element types or pagination metadata.
|
|
625
|
+
* `Map<CityInfo, Forecast>` is ambiguous under this rule and is accepted as such — the field
|
|
626
|
+
* list is evidence for a drafting agent, not a contract the gate enforces.
|
|
627
|
+
*/
|
|
628
|
+
function attachResponseFields(entities, endpoints) {
|
|
629
|
+
const byName = new Map();
|
|
630
|
+
for (const e of entities) byName.set(e.name, e.fields.map((f) => f.name));
|
|
631
|
+
return endpoints.map((e) => {
|
|
632
|
+
if (typeof e.response !== "string") return e;
|
|
633
|
+
const names = [...e.response.matchAll(/[A-Za-z_]\w*/g)].map((m) => m[0]);
|
|
634
|
+
const hit = [...names].reverse().find((n) => byName.has(n));
|
|
635
|
+
return hit === undefined ? e : { ...e, response_fields: byName.get(hit) };
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// ---------------------------------------------------------------------------
|
|
640
|
+
// stores
|
|
641
|
+
// ---------------------------------------------------------------------------
|
|
642
|
+
|
|
643
|
+
// Group order: 1 type, 2 literal key, 3 identifier key, 4 default. The identifier branch exists
|
|
644
|
+
// because real code stores the key in a same-file constant far more often than it repeats the
|
|
645
|
+
// string; `scanConstants` turns that name back into the literal, and a name that does not resolve
|
|
646
|
+
// stays unresolved rather than becoming a key named after the constant.
|
|
647
|
+
/**
|
|
648
|
+
* Variables that really hold a preferences object.
|
|
649
|
+
*
|
|
650
|
+
* A `.get<Type>(…)` is a preference read only when the object receiving it was DECLARED as a
|
|
651
|
+
* `SharedPreferences` in this file, or came from `getSharedPreferences(...)` /
|
|
652
|
+
* `getDefaultSharedPreferences(...)`. Both the Java (`Type name`) and Kotlin (`name: Type`)
|
|
653
|
+
* declaration orders are matched. An unresolved receiver yields nothing.
|
|
654
|
+
*/
|
|
655
|
+
const SP_DECL_RE = /\bSharedPreferences\s+([A-Za-z_]\w*)|\b([A-Za-z_]\w*)\s*:\s*SharedPreferences\b/g;
|
|
656
|
+
const SP_FACTORY_RE = /\b([A-Za-z_]\w*)\s*=\s*[^;\n]*\b(?:getSharedPreferences|getDefaultSharedPreferences)\s*\(/g;
|
|
657
|
+
|
|
658
|
+
/** Names of preferences objects declared or obtained in `text`. */
|
|
659
|
+
function sharedPreferencesNames(text) {
|
|
660
|
+
const names = new Set();
|
|
661
|
+
for (const m of text.matchAll(SP_DECL_RE)) {
|
|
662
|
+
const name = m[1] ?? m[2];
|
|
663
|
+
if (name !== undefined) names.add(name);
|
|
664
|
+
}
|
|
665
|
+
for (const m of text.matchAll(SP_FACTORY_RE)) names.add(m[1]);
|
|
666
|
+
return names;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* A declared type that IS a preference store, whatever the platform calls it.
|
|
671
|
+
*
|
|
672
|
+
* The suffix test is what makes this platform-neutral rather than Android-shaped: `SharedPreferences`
|
|
673
|
+
* (Android), `Preferences` (AndroidX / desktop), `PreferenceStore` (a project-defined interface
|
|
674
|
+
* over either), and `SharedPreferences.Editor`. A type that does not end in one of those is not a store,
|
|
675
|
+
* and a `.get*(…)` call on it reads something else.
|
|
676
|
+
*
|
|
677
|
+
* `Preference<Boolean>` is deliberately NOT one: that is a HANDLE onto a store (for example,
|
|
678
|
+
* `val themeDarkAmoled: Preference<Boolean>`), not the store itself, so a call on it is not a call
|
|
679
|
+
* on storage.
|
|
680
|
+
*/
|
|
681
|
+
const PREF_RECEIVER_TYPE_RE = /(?:Preferences?|PreferenceStore|SharedPreferences\.Editor)$/;
|
|
682
|
+
|
|
683
|
+
// Declarations whose TYPE we care about, in both orderings. The patterns are deliberately broad —
|
|
684
|
+
// they match every `name: Type` and `Type name` in a JVM file — because the type filter above is
|
|
685
|
+
// what narrows them. Pre-narrowing the PATTERN would have to know which syntactic positions can
|
|
686
|
+
// declare things, and that is the fragile half. The trailing `(?![\w.<])` excludes a generic
|
|
687
|
+
// parameterised declaration (`x: Preference<Boolean>`), which would otherwise be read as type
|
|
688
|
+
// `Preference`.
|
|
689
|
+
const KT_TYPE_DECL_RE = /\b([A-Za-z_]\w*)\s*:\s*([A-Za-z_][\w.]*(?:\.[A-Za-z_]\w*)*)(?![\w.<])/g;
|
|
690
|
+
const JAVA_TYPE_DECL_RE = /\b([A-Za-z_][\w.]*(?:\.[A-Za-z_]\w*)*)\s+([A-Za-z_]\w*)\s*(?=[;=,)])/g;
|
|
691
|
+
|
|
692
|
+
/** A receiver the preference scanner might have to qualify: `name.get<Type>(` and friends. */
|
|
693
|
+
const PREF_CALL_RECEIVER_RE = /\b([A-Za-z_]\w*)\.(?:get|put|remove)(?:String|Int|Long|Float|Boolean|StringSet)\(/g;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Receiver name -> declared types, from ONE file. Only preference-shaped types are kept: a project
|
|
697
|
+
* declares tens of thousands of variables and a handful are stores, so keeping the rest would make
|
|
698
|
+
* this the largest structure the build holds.
|
|
699
|
+
*/
|
|
700
|
+
function prefReceiverTypes(text) {
|
|
701
|
+
const out = new Map();
|
|
702
|
+
const put = (name, type) => {
|
|
703
|
+
if (!PREF_RECEIVER_TYPE_RE.test(type)) return;
|
|
704
|
+
if (!out.has(name)) out.set(name, new Set());
|
|
705
|
+
out.get(name).add(type);
|
|
706
|
+
};
|
|
707
|
+
for (const m of text.matchAll(KT_TYPE_DECL_RE)) put(m[1], m[2]);
|
|
708
|
+
for (const m of text.matchAll(JAVA_TYPE_DECL_RE)) put(m[2], m[1]);
|
|
709
|
+
return out;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* What the WHOLE project declares about each receiver name it uses as a store.
|
|
714
|
+
*
|
|
715
|
+
* A class that holds a `SharedPreferences` / `PreferenceStore` field is store-shaped. The
|
|
716
|
+
* propagation is one pass:
|
|
717
|
+
* 1. Collect classes that directly hold a pref-typed field/param into `containerTypes`.
|
|
718
|
+
* 2. Also accept a receiver whose declared type is in `containerTypes`.
|
|
719
|
+
* Only one wrapper hop is propagated. The `other` flag still fires when a name is also declared
|
|
720
|
+
* as a non-store type.
|
|
721
|
+
*
|
|
722
|
+
* @param {Iterable<string>} texts - comment-stripped JVM sources
|
|
723
|
+
* @returns {Map<string, {pref: Set<string>, other: boolean}>}
|
|
724
|
+
*/
|
|
725
|
+
function collectProjectReceivers(texts) {
|
|
726
|
+
const list = [...texts];
|
|
727
|
+
// Stage 1a: every name used as a store receiver anywhere.
|
|
728
|
+
const used = new Set();
|
|
729
|
+
for (const text of list) {
|
|
730
|
+
for (const m of text.matchAll(PREF_CALL_RECEIVER_RE)) used.add(m[1]);
|
|
731
|
+
}
|
|
732
|
+
if (used.size === 0) return new Map();
|
|
733
|
+
|
|
734
|
+
// Stage 1b: container-type propagation. For each class body that holds a pref-typed
|
|
735
|
+
// field/ctor-param, record the class name as an additional pref-shaped type. One pass over all
|
|
736
|
+
// files; only classes that hold at least one pref-typed name are collected.
|
|
737
|
+
//
|
|
738
|
+
// The regex captures the class name from `class Foo(…pref: PreferenceStore…)` or from
|
|
739
|
+
// `class Foo { val prefs: SharedPreferences }`. It does not attempt to parse full class bodies —
|
|
740
|
+
// it just looks for a class keyword followed by a name and then, within the next 2 KB, a
|
|
741
|
+
// Kotlin-or-Java pref-typed declaration.
|
|
742
|
+
const CLASS_NAME_RE = /\bclass\s+([A-Za-z_]\w*)/g;
|
|
743
|
+
const containerTypes = new Set();
|
|
744
|
+
for (const text of list) {
|
|
745
|
+
let cm;
|
|
746
|
+
CLASS_NAME_RE.lastIndex = 0;
|
|
747
|
+
while ((cm = CLASS_NAME_RE.exec(text)) !== null) {
|
|
748
|
+
const className = cm[1];
|
|
749
|
+
// Look in the next ~2 KB of text after the class keyword for a pref-typed declaration.
|
|
750
|
+
const window = text.slice(cm.index, cm.index + 2048);
|
|
751
|
+
let found = false;
|
|
752
|
+
for (const m of window.matchAll(KT_TYPE_DECL_RE)) {
|
|
753
|
+
if (PREF_RECEIVER_TYPE_RE.test(m[2])) { found = true; break; }
|
|
754
|
+
}
|
|
755
|
+
if (!found) {
|
|
756
|
+
for (const m of window.matchAll(JAVA_TYPE_DECL_RE)) {
|
|
757
|
+
if (PREF_RECEIVER_TYPE_RE.test(m[1])) { found = true; break; }
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
if (found) containerTypes.add(className);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// Stage 2: for each used name, what does the project say it is? Every file must be consulted.
|
|
765
|
+
const out = new Map();
|
|
766
|
+
const ensure = (name) => {
|
|
767
|
+
let entry = out.get(name);
|
|
768
|
+
if (entry === undefined) {
|
|
769
|
+
entry = { pref: new Set(), other: false };
|
|
770
|
+
out.set(name, entry);
|
|
771
|
+
}
|
|
772
|
+
return entry;
|
|
773
|
+
};
|
|
774
|
+
for (const name of used) ensure(name);
|
|
775
|
+
for (const text of list) {
|
|
776
|
+
for (const m of text.matchAll(KT_TYPE_DECL_RE)) {
|
|
777
|
+
if (!used.has(m[1])) continue;
|
|
778
|
+
const entry = ensure(m[1]);
|
|
779
|
+
if (PREF_RECEIVER_TYPE_RE.test(m[2]) || containerTypes.has(m[2])) entry.pref.add(m[2]);
|
|
780
|
+
else entry.other = true;
|
|
781
|
+
}
|
|
782
|
+
for (const m of text.matchAll(JAVA_TYPE_DECL_RE)) {
|
|
783
|
+
if (!used.has(m[2])) continue;
|
|
784
|
+
const entry = ensure(m[2]);
|
|
785
|
+
if (PREF_RECEIVER_TYPE_RE.test(m[1]) || containerTypes.has(m[1])) entry.pref.add(m[1]);
|
|
786
|
+
else entry.other = true;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return out;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Only bare literals are usable defaults. Expressions evaluated at read time are recorded as no
|
|
794
|
+
* default rather than reproduced as values.
|
|
795
|
+
*/
|
|
796
|
+
function literalDefault(raw) {
|
|
797
|
+
const v = String(raw ?? "").trim();
|
|
798
|
+
if (/^"(?:\\.|[^"\\])*"$/.test(v)) return v; // "text"
|
|
799
|
+
if (/^-?\d+(?:\.\d+)?[fLdD]?$/.test(v)) return v; // 42 / 1.5f
|
|
800
|
+
if (/^(?:true|false)$/.test(v)) return v; // boolean
|
|
801
|
+
if (v === "null") return null; // an explicit null IS the default
|
|
802
|
+
return null;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
const PREF_GET_RE = /\.get(String|Int|Long|Float|Boolean|StringSet)\(\s*(?:"([^"]+)"|([A-Za-z_]\w*))\s*(?:,\s*([^)]*))?\)/g;
|
|
806
|
+
const PREF_PUT_RE = /\.put(String|Int|Long|Float|Boolean|StringSet)\(\s*(?:"([^"]+)"|([A-Za-z_]\w*))\s*(?:,\s*([^)]*))?\)/g;
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* MMKV's own API is `mmkv.encode(key, v)`, but most projects do not call it — they wrap it, and
|
|
810
|
+
* the wrapper is what appears at every call site:
|
|
811
|
+
*
|
|
812
|
+
* MMKVUtils.putString(KEY_AUTH, authJson) // wrapper writes
|
|
813
|
+
* MMKVUtils.getString(KEY_THEME_MODE, DEFAULT) // and their reads
|
|
814
|
+
*
|
|
815
|
+
* Guarded on the receiver containing `mmkv`, so a `prefsHelper.putString` is not mistaken for a
|
|
816
|
+
* store, and on the key being literal or resolving to one.
|
|
817
|
+
*
|
|
818
|
+
* Group order: 1 receiver, 2 put|get, 3 type suffix, 4 literal key, 5 identifier key, 6 rest.
|
|
819
|
+
* The verb and its `String`/`Bool` suffix are separate captures.
|
|
820
|
+
*/
|
|
821
|
+
const MMKV_WRAPPER_RE = /\b([A-Za-z_$][\w$.]*(?:\s*\(\))?)\s*\.\s*(put|get)([A-Za-z]\w*)\(\s*(?:"([^"]+)"|([A-Za-z_]\w*))\s*(?:,\s*([^)]*))?\)/g;
|
|
822
|
+
/** Wrapper method type suffix -> the PREF_TYPE vocabulary. */
|
|
823
|
+
const MMKV_WRAPPER_TYPE = {
|
|
824
|
+
String: "string", Int: "int", Long: "long", Float: "float", Double: "double",
|
|
825
|
+
Bool: "boolean", Boolean: "boolean", ByteArray: "bytearray", Bytes: "bytearray",
|
|
826
|
+
StringSet: "set", Object: "object",
|
|
827
|
+
};
|
|
828
|
+
const DATASTORE_KEY_RE = /\b(string|int|long|float|boolean|double|stringSet)PreferencesKey\(\s*"([^"]+)"\s*\)/g;
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* True when a quoted string is really a literal value rather than a template the scanner cannot
|
|
832
|
+
* evaluate.
|
|
833
|
+
*
|
|
834
|
+
* `$` marks interpolation and `%` marks a format placeholder. A storage key containing either is
|
|
835
|
+
* source syntax rather than a literal the scanner can evaluate, so it is dropped.
|
|
836
|
+
*/
|
|
837
|
+
const nonLiteral = (value) => value.includes("$") || value.includes("%");
|
|
838
|
+
/**
|
|
839
|
+
* An MMKV receiver names an MMKV object. Everything else calling `.encode(...)` is a different
|
|
840
|
+
* API that happens to share the method name.
|
|
841
|
+
*
|
|
842
|
+
* Only an MMKV receiver and a LITERAL key identify an MMKV store entry. A wrapper's `key`
|
|
843
|
+
* argument is a parameter whose real value lives at its call site, so it is not recorded.
|
|
844
|
+
*
|
|
845
|
+
* Group order: 1 receiver, 2 encode|decode<Type>, 3 literal key, 4 identifier key, 5 default.
|
|
846
|
+
*/
|
|
847
|
+
const MMKV_RE = /\b([A-Za-z_$][\w$.]*(?:\s*\(\))?)\s*\.\s*(encode|decode\w+)\(\s*(?:"([^"]+)"|([A-Za-z_]\w*))\s*(?:,\s*([^)]*))?\)/g;
|
|
848
|
+
const MMKV_RECEIVER_RE = /mmkv/i;
|
|
849
|
+
|
|
850
|
+
const PREF_TYPE = {
|
|
851
|
+
String: "string", Int: "int", Long: "long", Float: "float", Boolean: "boolean", StringSet: "set",
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* @param {string} text - raw JVM source
|
|
856
|
+
* @param {string} rel - its repo-relative path, for `file`
|
|
857
|
+
* @param {Map<string, {pref: Set<string>, other: boolean}>} [receivers] project-wide receiver
|
|
858
|
+
* declarations from {@link collectProjectReceivers}. With it, a receiver declared in ANOTHER file
|
|
859
|
+
* is recognised; without it, only this file's own declarations count.
|
|
860
|
+
*/
|
|
861
|
+
function scanStores(text, rel, receivers = undefined) {
|
|
862
|
+
const cleaned = stripJvmComments(text);
|
|
863
|
+
const byKey = new Map();
|
|
864
|
+
/**
|
|
865
|
+
* First writer wins for the key's identity, but a later `decode<Type>` call UPGRADES an
|
|
866
|
+
* `unknown` type. MMKV's `encode(key, value)` takes the type from an argument the regex cannot
|
|
867
|
+
* resolve, while `decodeString(key)` names it in the method name — and real code usually
|
|
868
|
+
* encodes before it decodes, so first-wins alone would label every key `unknown`.
|
|
869
|
+
*/
|
|
870
|
+
const add = (key, entry) => {
|
|
871
|
+
const existing = byKey.get(key);
|
|
872
|
+
if (existing === undefined) {
|
|
873
|
+
byKey.set(key, { key, ...entry, file: rel });
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
876
|
+
if (existing.type === "unknown" && entry.type !== undefined && entry.type !== "unknown") {
|
|
877
|
+
existing.type = entry.type;
|
|
878
|
+
if (existing.default === null && entry.default !== undefined) existing.default = entry.default;
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
const consts = scanConstants(text, rel);
|
|
883
|
+
const localPrefNames = sharedPreferencesNames(cleaned);
|
|
884
|
+
/**
|
|
885
|
+
* Is `name` a preferences object?
|
|
886
|
+
*
|
|
887
|
+
* Three sources, in order of confidence:
|
|
888
|
+
* 1. this file declares it as one (`localPrefNames`);
|
|
889
|
+
* 2. the project declares it as one and never as anything else (`receivers`);
|
|
890
|
+
* 3. it came from `getSharedPreferences(...)` — already covered by (1), since that assigns to a
|
|
891
|
+
* local name.
|
|
892
|
+
* A name the project declares BOTH ways is rejected: an ambiguous receiver is not evidence.
|
|
893
|
+
*/
|
|
894
|
+
const isPrefReceiver = (name) => {
|
|
895
|
+
if (localPrefNames.has(name)) return true;
|
|
896
|
+
if (receivers === undefined) return false;
|
|
897
|
+
const entry = receivers.get(name);
|
|
898
|
+
if (entry === undefined) return false;
|
|
899
|
+
return entry.pref.size > 0 && !entry.other;
|
|
900
|
+
};
|
|
901
|
+
{
|
|
902
|
+
// Receiver-qualified: `.get<Type>(…)` counts only when the receiver is a preferences object.
|
|
903
|
+
// See PREF_RECEIVER_TYPE_RE and collectProjectReceivers.
|
|
904
|
+
const receiver = new RegExp(`\\b([A-Za-z_]\\w*)${PREF_GET_RE.source.slice(1)}`, PREF_GET_RE.flags);
|
|
905
|
+
const writer = new RegExp(`\\b([A-Za-z_]\\w*)${PREF_PUT_RE.source.slice(1)}`, PREF_PUT_RE.flags);
|
|
906
|
+
for (const [re, isRead] of [[receiver, true], [writer, false]]) {
|
|
907
|
+
for (const m of cleaned.matchAll(re)) {
|
|
908
|
+
if (!isPrefReceiver(m[1])) continue;
|
|
909
|
+
const key = m[3] ?? resolveConst(m[4], consts);
|
|
910
|
+
if (key === null || nonLiteral(key)) continue;
|
|
911
|
+
add(key, {
|
|
912
|
+
kind: "sharedpreferences",
|
|
913
|
+
type: PREF_TYPE[m[2]] ?? m[2],
|
|
914
|
+
// A read's third argument IS the default. A write's is the value being stored, so it
|
|
915
|
+
// says nothing about the default and is not recorded.
|
|
916
|
+
default: isRead && m[5] !== undefined ? literalDefault(m[5]) : null,
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
for (const m of cleaned.matchAll(DATASTORE_KEY_RE)) {
|
|
922
|
+
if (nonLiteral(m[2])) continue;
|
|
923
|
+
add(m[2], { kind: "datastore", type: PREF_TYPE[m[1]] ?? m[1], default: null });
|
|
924
|
+
}
|
|
925
|
+
for (const m of cleaned.matchAll(MMKV_RE)) {
|
|
926
|
+
if (!MMKV_RECEIVER_RE.test(m[1])) continue;
|
|
927
|
+
// Only a LITERAL key names a store. `defaultMMKV.encode(key, value)` is the wrapper's own
|
|
928
|
+
// signature; recording `key` would emit a key that exists nowhere and that no coder can look
|
|
929
|
+
// up. Losing one indirect MMKV usage is cheaper than inventing a key.
|
|
930
|
+
if (m[3] === undefined) continue;
|
|
931
|
+
add(m[3], {
|
|
932
|
+
kind: "mmkv",
|
|
933
|
+
type: m[2].startsWith("decode") ? m[2].slice("decode".length).toLowerCase() : "unknown",
|
|
934
|
+
default: m[5] === undefined ? null : m[5].trim(),
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
// The wrapper shape (`MMKVUtils.putString(KEY_AUTH, v)`). Kept separate from MMKV_RE because
|
|
938
|
+
// the two APIs are unrelated: one is MMKV's own member, this is somebody's static helper.
|
|
939
|
+
for (const m of cleaned.matchAll(MMKV_WRAPPER_RE)) {
|
|
940
|
+
if (!MMKV_RECEIVER_RE.test(m[1])) continue;
|
|
941
|
+
const key = m[4] ?? resolveConst(m[5], consts);
|
|
942
|
+
if (key === null) continue;
|
|
943
|
+
add(key, {
|
|
944
|
+
kind: "mmkv",
|
|
945
|
+
type: MMKV_WRAPPER_TYPE[m[3]] ?? "unknown",
|
|
946
|
+
// A `get` call's second argument IS the default the app falls back to; a `put` call's is the
|
|
947
|
+
// value being written. Only the read names a default, so only the read contributes one.
|
|
948
|
+
default: m[2] === "get" && m[6] !== undefined ? m[6].trim() : null,
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
return [...byKey.values()];
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
// ---------------------------------------------------------------------------
|
|
955
|
+
// preference screens (res/xml) + string arrays (res/values*/arrays.xml)
|
|
956
|
+
// ---------------------------------------------------------------------------
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* Attributes are namespaced in practice (`app:key`, `android:key`), and the prefix is not stable
|
|
960
|
+
* across projects — `res-auto` lets each project pick anything. Matching the local name with an
|
|
961
|
+
* optional prefix gets both. A bare `key` attribute is legal too.
|
|
962
|
+
*/
|
|
963
|
+
function xmlAttr(attrs, name) {
|
|
964
|
+
const m = new RegExp(`(?:^|\\s)(?:[A-Za-z][\\w-]*:)?${name}\\s*=\\s*"([^"]*)"`).exec(attrs);
|
|
965
|
+
return m === null ? null : decodeXml(m[1].trim());
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
const PREF_ELEMENT_RE = /<(ListPreference|MultiSelectListPreference|DropDownPreference)\b([^>]*?)\/?>/g;
|
|
969
|
+
const PREF_KIND_OF = { ListPreference: "list", MultiSelectListPreference: "set", DropDownPreference: "list" };
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* One entry per preference element that declares a `key`.
|
|
973
|
+
*
|
|
974
|
+
* A settings screen's values can live only in XML, so preference elements and their arrays are
|
|
975
|
+
* collected together.
|
|
976
|
+
*
|
|
977
|
+
* The element's `app:entries` / `app:entryValues` are returned as RAW references. They are
|
|
978
|
+
* resolved after the whole tree is read, because `arrays.xml` and `strings.xml` may sort after the
|
|
979
|
+
* screen that points at them.
|
|
980
|
+
*/
|
|
981
|
+
function scanPreferenceScreen(text, rel) {
|
|
982
|
+
const cleaned = String(text ?? "").replace(/<!--[\s\S]*?-->/g, "");
|
|
983
|
+
const out = [];
|
|
984
|
+
for (const m of cleaned.matchAll(PREF_ELEMENT_RE)) {
|
|
985
|
+
const key = xmlAttr(m[2], "key");
|
|
986
|
+
if (key === null || key === "") continue;
|
|
987
|
+
out.push({
|
|
988
|
+
key,
|
|
989
|
+
kind: PREF_KIND_OF[m[1]] ?? "list",
|
|
990
|
+
default: xmlAttr(m[2], "defaultValue"),
|
|
991
|
+
title_ref: xmlAttr(m[2], "title"),
|
|
992
|
+
entries_ref: xmlAttr(m[2], "entries"),
|
|
993
|
+
values_ref: xmlAttr(m[2], "entryValues"),
|
|
994
|
+
file: rel,
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
return out;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
const XML_ARRAY_RE = /<string-array\b[^>]*?\bname\s*=\s*"([^"]+)"[^>]*>([\s\S]*?)<\/string-array>/g;
|
|
1001
|
+
const XML_ITEM_RE = /<item\b[^>]*>([\s\S]*?)<\/item>/g;
|
|
1002
|
+
|
|
1003
|
+
/** `name -> [item, ...]`, one map per `arrays.xml`. */
|
|
1004
|
+
function scanStringArrays(text) {
|
|
1005
|
+
const cleaned = String(text ?? "").replace(/<!--[\s\S]*?-->/g, "");
|
|
1006
|
+
const out = new Map();
|
|
1007
|
+
for (const m of cleaned.matchAll(XML_ARRAY_RE)) {
|
|
1008
|
+
const items = [...m[2].matchAll(XML_ITEM_RE)].map((item) => decodeXml(item[1]).trim());
|
|
1009
|
+
out.set(m[1], items);
|
|
1010
|
+
}
|
|
1011
|
+
return out;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
/** `@array/foo` / `@string/bar` -> `{kind, name}`, or null for a plain literal. */
|
|
1015
|
+
function resourceRef(value) {
|
|
1016
|
+
const m = /^@(array|string)\/(.+)$/.exec(String(value ?? "").trim());
|
|
1017
|
+
return m === null ? null : { kind: m[1], name: m[2] };
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
/** The `@string/x` copy, preferring the unqualified column. Null when it does not resolve. */
|
|
1021
|
+
function resolveString(strings, reference) {
|
|
1022
|
+
const ref = resourceRef(reference);
|
|
1023
|
+
if (ref === null || ref.kind !== "string") return null;
|
|
1024
|
+
const entry = strings[ref.name];
|
|
1025
|
+
if (entry === undefined) return null;
|
|
1026
|
+
const column = entry.default ?? Object.values(entry)[0];
|
|
1027
|
+
return typeof column === "string" ? column : null;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Turn one preference screen entry into a `stores.json` entry.
|
|
1032
|
+
*
|
|
1033
|
+
* THE RULE, and it is the one that matters for a coder reading the output: `values` is emitted
|
|
1034
|
+
* WHOLE or not at all. If any item of the `entryValues` array fails to resolve to a literal, the
|
|
1035
|
+
* enumeration is omitted and the store keeps only its key and default. A partial list is worse
|
|
1036
|
+
* than none — "kmh, mph" reads as complete and would have a coder implement a switch that can
|
|
1037
|
+
* never produce `ms`, while an absent list at least says "go read the source".
|
|
1038
|
+
*
|
|
1039
|
+
* Labels are optional and independent: they come from the parallel `entries` array and are emitted
|
|
1040
|
+
* per item when they resolve. A missing label costs a nicer string, never a wrong value.
|
|
1041
|
+
*/
|
|
1042
|
+
function preferenceStore(pref, strings, arrays) {
|
|
1043
|
+
// Resolve a resource-reference key to its value. An unresolvable reference yields no store.
|
|
1044
|
+
const key = resourceRef(pref.key) === null ? pref.key : resolveString(strings, pref.key);
|
|
1045
|
+
if (key === null || key === "" || nonLiteral(key)) return null;
|
|
1046
|
+
|
|
1047
|
+
const entry = { key, kind: "preference", type: pref.kind, default: pref.default, file: pref.file };
|
|
1048
|
+
if (pref.default !== null && nonLiteral(pref.default)) delete entry.default;
|
|
1049
|
+
const title = pref.title_ref === null ? null : resolveString(strings, pref.title_ref);
|
|
1050
|
+
if (title !== null) entry.title = title;
|
|
1051
|
+
|
|
1052
|
+
const valuesRef = resourceRef(pref.values_ref);
|
|
1053
|
+
if (valuesRef !== null && valuesRef.kind === "array") {
|
|
1054
|
+
const raw = arrays.get(valuesRef.name);
|
|
1055
|
+
if (raw !== undefined) {
|
|
1056
|
+
const resolved = raw.map((item) => resolveString(strings, item) ?? (resourceRef(item) === null ? item : null));
|
|
1057
|
+
if (resolved.every((v) => v !== null && v !== "")) {
|
|
1058
|
+
const entriesRef = resourceRef(pref.entries_ref);
|
|
1059
|
+
const labels = entriesRef !== null && entriesRef.kind === "array" ? (arrays.get(entriesRef.name) ?? []) : [];
|
|
1060
|
+
entry.values = resolved.map((value, i) => {
|
|
1061
|
+
const label = labels[i] === undefined ? null : resolveString(strings, labels[i]) ?? labels[i];
|
|
1062
|
+
return label === null ? value : { value, label };
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
return entry;
|
|
1068
|
+
}
|
|
1069
|
+
const XML_STRING_RE = /<string\b[^>]*\bname\s*=\s*"([^"]+)"[^>]*>([\s\S]*?)<\/string>/g;
|
|
1070
|
+
const XML_ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'" };
|
|
1071
|
+
const REPLACEMENT_CHAR = "�";
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* A code point is emittable when it is in range and not a lone surrogate. `String.fromCodePoint`
|
|
1075
|
+
* throws `RangeError` for `�` and for `�`, and an uncaught throw here would
|
|
1076
|
+
* abandon all six `facts/` files over one malformed entity — every other scanner in this module
|
|
1077
|
+
* degrades to "that item is skipped", so this one must too.
|
|
1078
|
+
*/
|
|
1079
|
+
function isEmittableCodePoint(cp) {
|
|
1080
|
+
return Number.isInteger(cp) && cp >= 0 && cp <= 0x10FFFF && !(cp >= 0xD800 && cp <= 0xDFFF);
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
const decodeXml = (s) => String(s).replace(/&(#x?[0-9a-fA-F]+|\w+);/g, (whole, body) => {
|
|
1084
|
+
if (body.startsWith("#x") || body.startsWith("#X")) {
|
|
1085
|
+
const cp = parseInt(body.slice(2), 16);
|
|
1086
|
+
return isEmittableCodePoint(cp) ? String.fromCodePoint(cp) : REPLACEMENT_CHAR;
|
|
1087
|
+
}
|
|
1088
|
+
if (body.startsWith("#")) {
|
|
1089
|
+
const cp = parseInt(body.slice(1), 10);
|
|
1090
|
+
return isEmittableCodePoint(cp) ? String.fromCodePoint(cp) : REPLACEMENT_CHAR;
|
|
1091
|
+
}
|
|
1092
|
+
return XML_ENTITIES[body] ?? whole;
|
|
1093
|
+
});
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* Android resource qualifier -> language tag.
|
|
1097
|
+
*
|
|
1098
|
+
* Only two shapes name a language: `values` (the unqualified default) and `values-<2 letters>`
|
|
1099
|
+
* optionally followed by `-r<REGION>` (`values-zh`, `values-zh-rCN`). Every other qualifier is a
|
|
1100
|
+
* configuration variant — `values-night`, `values-land`, `values-v21`, `values-sw600dp` are all
|
|
1101
|
+
* `default` copy under a different configuration, and treating them as languages splits one
|
|
1102
|
+
* string into five bogus "translations". `values-b+zh+Hans` is a BCP-47 tag: the first subtag
|
|
1103
|
+
* after `b+` is the language.
|
|
1104
|
+
*
|
|
1105
|
+
* Anything unrecognised falls back to `default` rather than to an invented language.
|
|
1106
|
+
*/
|
|
1107
|
+
export function stringsLang(qualifier) {
|
|
1108
|
+
if (qualifier === undefined || qualifier === "") return "default";
|
|
1109
|
+
if (qualifier.startsWith("b+")) {
|
|
1110
|
+
const first = qualifier.slice(2).split("+").find((part) => part !== "");
|
|
1111
|
+
return first === undefined ? "default" : first.toLowerCase();
|
|
1112
|
+
}
|
|
1113
|
+
const language = /^([A-Za-z]{2})(?:-r[A-Za-z]{2})?$/.exec(qualifier);
|
|
1114
|
+
return language === null ? "default" : language[1].toLowerCase();
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* True when `qualifier` is a configuration variant rather than a language.
|
|
1119
|
+
*
|
|
1120
|
+
* A configuration variant is emitted as its own qualifier-suffixed column instead of being merged
|
|
1121
|
+
* into `default`. The unqualified copy stays authoritative, variant values remain available, and
|
|
1122
|
+
* no value depends on walk order. `stringsLang` selects the language; `stringsColumn` selects the
|
|
1123
|
+
* unique output column.
|
|
1124
|
+
*/
|
|
1125
|
+
export function isConfigVariant(qualifier) {
|
|
1126
|
+
if (qualifier === undefined || qualifier === "") return false;
|
|
1127
|
+
if (qualifier.startsWith("b+")) return false;
|
|
1128
|
+
return !/^[A-Za-z]{2}(?:-r[A-Za-z]{2})?$/.test(qualifier);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Column name a `strings.xml` contributes to.
|
|
1133
|
+
*
|
|
1134
|
+
* `values` -> `default`; `values-zh` -> `zh`; `values-night` -> `default-night`; a BCP-47 tag ->
|
|
1135
|
+
* its language. A language qualifier that ALSO carries a configuration (`values-zh-night`) keeps
|
|
1136
|
+
* both: the language in front, the config after, so it still collides with nothing.
|
|
1137
|
+
*/
|
|
1138
|
+
export function stringsColumn(qualifier) {
|
|
1139
|
+
if (!isConfigVariant(qualifier)) return stringsLang(qualifier);
|
|
1140
|
+
const parts = qualifier.split("-");
|
|
1141
|
+
// Language part, if the qualifier starts with one (`zh-night`), else the plain default. The
|
|
1142
|
+
// configuration suffix is kept VERBATIM — `zh-rCN-night` -> `zh-rCN-night`, not `zh-rcn-night`:
|
|
1143
|
+
// Android qualifiers are case-sensitive in the directory name, and lowercasing a region tag
|
|
1144
|
+
// would invent a spelling that identifies nothing.
|
|
1145
|
+
const language = parts.length > 1 && /^[A-Za-z]{2}$/.test(parts[0])
|
|
1146
|
+
? parts[0].toLowerCase()
|
|
1147
|
+
: stringsLang(undefined);
|
|
1148
|
+
const config = language === "default" ? qualifier : parts.slice(1).join("-");
|
|
1149
|
+
return `${language}-${config}`;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/** Key -> language -> copy, from one `strings.xml`. */
|
|
1153
|
+
function scanStringsXml(text) {
|
|
1154
|
+
const cleaned = String(text ?? "").replace(/<!--[\s\S]*?-->/g, "");
|
|
1155
|
+
const out = [];
|
|
1156
|
+
for (const m of cleaned.matchAll(XML_STRING_RE)) {
|
|
1157
|
+
out.push({ key: m[1], value: decodeXml(m[2]).trim() });
|
|
1158
|
+
}
|
|
1159
|
+
return out;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
const I18N_ENTRY_RE = /(?:^|\n)\s*([A-Za-z_]\w*)\s*:\s*(['"`])((?:\\.|(?!\2)[\s\S])*?)\2\s*,?/g;
|
|
1163
|
+
|
|
1164
|
+
/** Key -> copy from an `i18n/<lang>.js` default-exported object. String values only. */
|
|
1165
|
+
function scanI18nObject(text) {
|
|
1166
|
+
const out = [];
|
|
1167
|
+
for (const m of String(text ?? "").matchAll(I18N_ENTRY_RE)) {
|
|
1168
|
+
out.push({ key: m[1], value: m[3].replace(/\\(['"`\\])/g, "$1") });
|
|
1169
|
+
}
|
|
1170
|
+
return out;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
// ---------------------------------------------------------------------------
|
|
1174
|
+
// uni-app sources (.js / .ts / .vue)
|
|
1175
|
+
// ---------------------------------------------------------------------------
|
|
1176
|
+
//
|
|
1177
|
+
// These scanners read LITERALS. They find that a request exists, where it goes and what it is
|
|
1178
|
+
// called with; they do not evaluate expressions or synthesize values. A computed argument stays
|
|
1179
|
+
// unresolved rather than becoming a placeholder that looks like a literal.
|
|
1180
|
+
|
|
1181
|
+
/** `uni.request({ url: '…', method: 'GET', timeout: 30000 })` — literal members only. */
|
|
1182
|
+
const UNI_REQUEST_RE = /uni\s*\.\s*request\s*\(\s*\{([\s\S]{0,600}?)\}\s*\)/g;
|
|
1183
|
+
/**
|
|
1184
|
+
* `uni.setStorageSync(KEY, v)` / `uni.getStorageSync(KEY)` / `uni.removeStorageSync(KEY)`.
|
|
1185
|
+
* Group order: 1 verb, 2-3 literal key (either quote), 4 identifier key.
|
|
1186
|
+
*/
|
|
1187
|
+
const STORAGE_CALL_RE = /uni\s*\.\s*(set|get|remove)StorageSync\(\s*(?:"([^"]+)"|'([^']+)'|([A-Za-z_$][\w$]*))/g;
|
|
1188
|
+
|
|
1189
|
+
/** A JS object literal's member, as its raw text; null when absent. */
|
|
1190
|
+
function jsMember(body, name) {
|
|
1191
|
+
const re = new RegExp(`(?:^|[{,\\s])["']?${name}["']?\\s*:\\s*("([^"]*)"|'([^']*)'|(-?[0-9]+(?:\\.[0-9]+)?))`);
|
|
1192
|
+
const m = re.exec(body);
|
|
1193
|
+
if (m === null) return null;
|
|
1194
|
+
return m[2] ?? m[3] ?? m[4];
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/** A literal URL, or null. An identifier used as a URL is left unresolved on purpose. */
|
|
1198
|
+
const literalUrl = (v) => (typeof v === "string" && /^https?:\/\//.test(v) ? v : null);
|
|
1199
|
+
|
|
1200
|
+
/**
|
|
1201
|
+
* Query parameter names from the two supported query-string shapes:
|
|
1202
|
+
*
|
|
1203
|
+
* 1. An array of pieces joined with `&`.
|
|
1204
|
+
* 2. An object literal passed to a callee named `…Query(…)` / `…Params(…)` in a file that also
|
|
1205
|
+
* joins with `&` or calls `encodeURIComponent`.
|
|
1206
|
+
*
|
|
1207
|
+
* Other quoted `name=value` text is ignored, including HTML attributes. When a query cannot be
|
|
1208
|
+
* established from these shapes, no parameters are emitted.
|
|
1209
|
+
*/
|
|
1210
|
+
const ARRAY_ASSIGN_RE = /\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*\[([\s\S]{0,3000}?)\]\s*(?:\r?\n|;|$)/g;
|
|
1211
|
+
const QUERY_OBJECT_CALL_RE = /\b([A-Za-z_$][\w$]*?(?:[Qq]uery|[Pp]arams)[A-Za-z_$]*)\s*\(\s*\{([\s\S]{0,1200}?)\}\s*\)/g;
|
|
1212
|
+
const QUOTED_PIECE_RE = /(["'`])\s*([A-Za-z_][\w.-]*)=((?:\\.|(?!\1)[^\\])*)\1/g;
|
|
1213
|
+
const OBJECT_KEY_RE = /(?:^|[{,])\s*["']?([A-Za-z_$][\w$]*)["']?\s*:/g;
|
|
1214
|
+
/** A `.js`/`.ts` file joins a query array with `&`, or encodes pieces, or it is not building one. */
|
|
1215
|
+
const JOINS_QUERY_RE = /\.join\(\s*["'`]&["'`]\s*\)|encodeURIComponent/;
|
|
1216
|
+
|
|
1217
|
+
/** Parameter entries from one piece-bearing text; values only when they are not interpolations. */
|
|
1218
|
+
function piecesOf(text) {
|
|
1219
|
+
const out = [];
|
|
1220
|
+
const seen = new Set();
|
|
1221
|
+
for (const m of text.matchAll(QUOTED_PIECE_RE)) {
|
|
1222
|
+
const name = m[2];
|
|
1223
|
+
if (seen.has(name)) continue;
|
|
1224
|
+
seen.add(name);
|
|
1225
|
+
const raw = m[3].trim();
|
|
1226
|
+
out.push({ in: "query", name, ...(raw !== "" && !raw.includes("${") ? { value: raw } : {}) });
|
|
1227
|
+
}
|
|
1228
|
+
return out;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
function scanQueryPieces(cleaned) {
|
|
1232
|
+
if (!JOINS_QUERY_RE.test(cleaned)) return [];
|
|
1233
|
+
const seen = new Set();
|
|
1234
|
+
const add = (entries) => {
|
|
1235
|
+
const fresh = entries.filter((e) => !seen.has(e.name));
|
|
1236
|
+
for (const e of fresh) seen.add(e.name);
|
|
1237
|
+
return fresh;
|
|
1238
|
+
};
|
|
1239
|
+
const out = [];
|
|
1240
|
+
|
|
1241
|
+
// 1. array + join('&')
|
|
1242
|
+
for (const m of cleaned.matchAll(ARRAY_ASSIGN_RE)) {
|
|
1243
|
+
const name = m[1];
|
|
1244
|
+
const joined = new RegExp(`\\b${name}\\s*\\.\\s*join\\(\\s*["'\`]&`).test(cleaned);
|
|
1245
|
+
if (!joined) continue;
|
|
1246
|
+
out.push(...add(piecesOf(m[2])));
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
// 2. object literal -> `…Query(…)` / `…Params(…)`, keys become the names
|
|
1250
|
+
const encodes = cleaned.includes("encodeURIComponent");
|
|
1251
|
+
for (const m of cleaned.matchAll(QUERY_OBJECT_CALL_RE)) {
|
|
1252
|
+
if (!encodes && !cleaned.includes(".join('&')") && !cleaned.includes('.join("&")')) continue;
|
|
1253
|
+
const names = [...m[2].matchAll(OBJECT_KEY_RE)].map((k) => k[1]);
|
|
1254
|
+
out.push(...add(names.map((name) => ({ in: "query", name }))));
|
|
1255
|
+
}
|
|
1256
|
+
return out;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
function scanUniEndpoints(text, rel) {
|
|
1260
|
+
const cleaned = stripJsComments(text);
|
|
1261
|
+
const baseUrls = [...cleaned.matchAll(BASE_URL_RE)].map((m) => m[1]);
|
|
1262
|
+
const pieces = scanQueryPieces(cleaned);
|
|
1263
|
+
const out = [];
|
|
1264
|
+
let attached = false;
|
|
1265
|
+
for (const m of cleaned.matchAll(UNI_REQUEST_RE)) {
|
|
1266
|
+
const body = m[1];
|
|
1267
|
+
const method = jsMember(body, "method");
|
|
1268
|
+
const timeout = jsMember(body, "timeout");
|
|
1269
|
+
const url = literalUrl(jsMember(body, "url"));
|
|
1270
|
+
attached = attached || pieces.length > 0;
|
|
1271
|
+
out.push({
|
|
1272
|
+
file: rel,
|
|
1273
|
+
protocol: "http",
|
|
1274
|
+
method: method === null ? null : method.toUpperCase(),
|
|
1275
|
+
path: null,
|
|
1276
|
+
...(url === null ? {} : { url }),
|
|
1277
|
+
...(timeout === null ? {} : { timeout: { name: "timeout", value: Number(timeout), unit: "MS" } }),
|
|
1278
|
+
// A wrapper that takes the URL as a parameter (`requestJson(url)`) states its parameters at
|
|
1279
|
+
// the CALL site, in the same file. Attaching them here is what makes the entry usable.
|
|
1280
|
+
...(pieces.length === 0 ? {} : { request: pieces }),
|
|
1281
|
+
});
|
|
1282
|
+
}
|
|
1283
|
+
// The service layer above the transport: `buildForecastUrl` assembles the query and returns a
|
|
1284
|
+
// string, and `requestJson(buildSearchUrl(...))` sends it from another file. The file states the
|
|
1285
|
+
// parameters and the base URL; it just does not open the socket. Emitting that as ONE entry is
|
|
1286
|
+
// honest — it describes the request this file defines, with no method invented for it.
|
|
1287
|
+
//
|
|
1288
|
+
// The condition is "this file contributed no request of its own", NOT "out is empty": a file
|
|
1289
|
+
// with a `BASE_URL` and no `uni.request` is exactly this case, and checking `out.length` after
|
|
1290
|
+
// pushing the base URL would never be true.
|
|
1291
|
+
if (!attached) {
|
|
1292
|
+
for (const base of baseUrls) {
|
|
1293
|
+
out.push({
|
|
1294
|
+
file: rel, protocol: "http", method: null, path: null, base_url: base,
|
|
1295
|
+
...(pieces.length === 0 ? {} : { request: pieces }),
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
if (baseUrls.length === 0 && pieces.length > 0) {
|
|
1299
|
+
out.push({ file: rel, protocol: "http", method: null, path: null, request: pieces });
|
|
1300
|
+
}
|
|
1301
|
+
} else {
|
|
1302
|
+
// Parameters already ride on the transport entry; the base URL still has to be reported, but
|
|
1303
|
+
// without repeating them, because two entries claiming the same parameter set reads as two
|
|
1304
|
+
// different requests.
|
|
1305
|
+
for (const base of baseUrls) {
|
|
1306
|
+
out.push({ file: rel, protocol: "http", method: null, path: null, base_url: base });
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
return out;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* Storage keys from `uni.*StorageSync`.
|
|
1314
|
+
*
|
|
1315
|
+
* The key must be a literal or a same-file `const` that resolves to one; `uni.getStorageSync(x)`
|
|
1316
|
+
* yields nothing, because `x`'s real value lives at a call site this scanner cannot see. Same rule
|
|
1317
|
+
* as the MMKV wrapper above, for the same reason: a key named after a parameter is a key no coder
|
|
1318
|
+
* can look up.
|
|
1319
|
+
*/
|
|
1320
|
+
function scanUniStores(text, rel) {
|
|
1321
|
+
const cleaned = stripJsComments(text);
|
|
1322
|
+
const consts = scanConstants(text, rel);
|
|
1323
|
+
const accessOf = { set: "write", get: "read", remove: "remove" };
|
|
1324
|
+
const byKey = new Map();
|
|
1325
|
+
for (const m of cleaned.matchAll(STORAGE_CALL_RE)) {
|
|
1326
|
+
const key = m[2] ?? m[3] ?? resolveConst(m[4], consts);
|
|
1327
|
+
if (key === null || key === "") continue;
|
|
1328
|
+
const existing = byKey.get(key);
|
|
1329
|
+
// A `set` proves the key is written, which is the stronger statement; a later `get` must not
|
|
1330
|
+
// downgrade it. One entry per key either way.
|
|
1331
|
+
if (existing === undefined || existing.access === "read") {
|
|
1332
|
+
byKey.set(key, {
|
|
1333
|
+
key, kind: "uni-storage", type: "unknown", default: null,
|
|
1334
|
+
access: accessOf[m[1]] ?? "read", file: rel,
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
return [...byKey.values()];
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
// ---------------------------------------------------------------------------
|
|
1342
|
+
// buildFacts
|
|
1343
|
+
// ---------------------------------------------------------------------------
|
|
1344
|
+
|
|
1345
|
+
function noteFactFailure(unknowns, operation, reason, error) {
|
|
1346
|
+
if (!unknowns.some(unknown => unknown.operation === operation)) {
|
|
1347
|
+
unknowns.push(factUnknown(operation, reason, error));
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
/** Run one scanner without allowing its failure to abort any other fact family. */
|
|
1352
|
+
function attemptFact(unknowns, operation, reason, callback, fallback) {
|
|
1353
|
+
try {
|
|
1354
|
+
return callback();
|
|
1355
|
+
} catch (error) {
|
|
1356
|
+
if (unknowns === null) throw error;
|
|
1357
|
+
noteFactFailure(unknowns, operation, reason, error);
|
|
1358
|
+
return fallback;
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* Collect facts or throw for the legacy writer. When `unknowns` is supplied,
|
|
1364
|
+
* every scanner and resolver degrades only its own fact family.
|
|
1365
|
+
*
|
|
1366
|
+
* @param {{sourceProject: string, gradleUserHome?: string, unknowns?: object[]|null,
|
|
1367
|
+
* scanners?: object}} args
|
|
1368
|
+
* `sourceProject` is read only. `gradleUserHome` is forwarded to
|
|
1369
|
+
* {@link resolveLibSources} so a test (or CI) can pin the Gradle cache.
|
|
1370
|
+
* `scanners` is an optional fault-injection seam for regression tests.
|
|
1371
|
+
* @returns {object} the complete in-memory fact base
|
|
1372
|
+
*/
|
|
1373
|
+
function collectFactsOrThrow({ sourceProject, gradleUserHome = undefined, unknowns = null, scanners = {} }) {
|
|
1374
|
+
let root;
|
|
1375
|
+
let files = [];
|
|
1376
|
+
let sourceError = null;
|
|
1377
|
+
try {
|
|
1378
|
+
root = path.resolve(sourceProject);
|
|
1379
|
+
if (!fs.existsSync(root)) {
|
|
1380
|
+
throw new Error(`source project not found: ${root}`);
|
|
1381
|
+
}
|
|
1382
|
+
files = (scanners.walk ?? walk)(root)
|
|
1383
|
+
.filter(file => !isExcludedEvidencePath(relPosix(root, file)));
|
|
1384
|
+
} catch (error) {
|
|
1385
|
+
sourceError = error;
|
|
1386
|
+
if (unknowns === null) throw error;
|
|
1387
|
+
// A shared source-walk failure prevents source-derived collection, but the
|
|
1388
|
+
// independent library resolver still runs below whenever the path is valid.
|
|
1389
|
+
for (const operation of ["entities", "endpoints", "stores", "strings", "symbols"]) {
|
|
1390
|
+
noteFactFailure(unknowns, operation, "source-walk-failed", error);
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
const entities = [];
|
|
1394
|
+
const endpoints = [];
|
|
1395
|
+
const stores = [];
|
|
1396
|
+
const strings = {};
|
|
1397
|
+
const symbolFiles = [];
|
|
1398
|
+
// Preference screens and their arrays are collected first and resolved after the walk, because
|
|
1399
|
+
// `<screen>.xml` sorts before `arrays.xml` in the same project and a reference to a name that
|
|
1400
|
+
// has not been read yet must not be reported as missing.
|
|
1401
|
+
const preferenceScreens = [];
|
|
1402
|
+
const stringArrays = new Map();
|
|
1403
|
+
|
|
1404
|
+
// Receiver declarations for the whole project, read BEFORE the main walk. `stores` needs them
|
|
1405
|
+
// because a preferences object can be declared in a different file. Only JVM sources are read,
|
|
1406
|
+
// and only files that call a store method contribute to the extra pass.
|
|
1407
|
+
const receivers = attemptFact(unknowns, "stores", "store-collection-failed", () => {
|
|
1408
|
+
const jvmTexts = [];
|
|
1409
|
+
for (const abs of files) {
|
|
1410
|
+
if (!JVM_RE.test(abs)) continue;
|
|
1411
|
+
const text = readText(abs);
|
|
1412
|
+
if (text !== null) jvmTexts.push((scanners.stripJvmComments ?? stripJvmComments)(text));
|
|
1413
|
+
}
|
|
1414
|
+
const projectReceivers = (scanners.collectProjectReceivers ?? collectProjectReceivers)(jvmTexts);
|
|
1415
|
+
jvmTexts.length = 0;
|
|
1416
|
+
return projectReceivers;
|
|
1417
|
+
}, undefined);
|
|
1418
|
+
|
|
1419
|
+
for (const abs of files) {
|
|
1420
|
+
const rel = relPosix(root, abs);
|
|
1421
|
+
if (SYMBOL_RE.test(abs)) symbolFiles.push(abs);
|
|
1422
|
+
|
|
1423
|
+
const stringsMatch = STRINGS_RE.exec(rel);
|
|
1424
|
+
if (stringsMatch !== null) {
|
|
1425
|
+
const column = stringsColumn(stringsMatch[1]);
|
|
1426
|
+
const text = readText(abs);
|
|
1427
|
+
if (text !== null) {
|
|
1428
|
+
for (const { key, value } of attemptFact(unknowns, "strings", "string-collection-failed",
|
|
1429
|
+
() => (scanners.scanStringsXml ?? scanStringsXml)(text), [])) {
|
|
1430
|
+
strings[key] = { ...(strings[key] ?? {}), [column]: value };
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
continue;
|
|
1434
|
+
}
|
|
1435
|
+
// moko's directory name is the language verbatim — `base` is the default copy. See
|
|
1436
|
+
// MOKO_STRINGS_RE for why stringsColumn must not be reused here.
|
|
1437
|
+
const mokoMatch = MOKO_STRINGS_RE.exec(rel);
|
|
1438
|
+
if (mokoMatch !== null) {
|
|
1439
|
+
const column = mokoMatch[1] === "base" ? "default" : mokoMatch[1];
|
|
1440
|
+
const text = readText(abs);
|
|
1441
|
+
if (text !== null) {
|
|
1442
|
+
for (const { key, value } of attemptFact(unknowns, "strings", "string-collection-failed",
|
|
1443
|
+
() => (scanners.scanStringsXml ?? scanStringsXml)(text), [])) {
|
|
1444
|
+
strings[key] = { ...(strings[key] ?? {}), [column]: value };
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
continue;
|
|
1448
|
+
}
|
|
1449
|
+
const i18nMatch = I18N_RE.exec(rel);
|
|
1450
|
+
if (i18nMatch !== null) {
|
|
1451
|
+
const text = readText(abs);
|
|
1452
|
+
if (text !== null) {
|
|
1453
|
+
for (const { key, value } of attemptFact(unknowns, "strings", "string-collection-failed",
|
|
1454
|
+
() => (scanners.scanI18nObject ?? scanI18nObject)(text), [])) {
|
|
1455
|
+
strings[key] = { ...(strings[key] ?? {}), [i18nMatch[1]]: value };
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
continue;
|
|
1459
|
+
}
|
|
1460
|
+
const arraysMatch = ARRAYS_XML_RE.exec(rel);
|
|
1461
|
+
if (arraysMatch !== null) {
|
|
1462
|
+
const text = readText(abs);
|
|
1463
|
+
// Only the unqualified `values/` arrays are authoritative: a `values-ru/arrays.xml` would
|
|
1464
|
+
// translate the LABELS, never the `entryValues`, and merging them would make the
|
|
1465
|
+
// enumeration depend on walk order.
|
|
1466
|
+
if (text !== null && !isConfigVariant(arraysMatch[1]) && stringsLang(arraysMatch[1]) === "default") {
|
|
1467
|
+
for (const [name, items] of attemptFact(unknowns, "stores", "store-collection-failed",
|
|
1468
|
+
() => (scanners.scanStringArrays ?? scanStringArrays)(text), new Map())) {
|
|
1469
|
+
if (!stringArrays.has(name)) stringArrays.set(name, items);
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
continue;
|
|
1473
|
+
}
|
|
1474
|
+
const prefMatch = PREF_XML_RE.exec(rel);
|
|
1475
|
+
if (prefMatch !== null) {
|
|
1476
|
+
const text = readText(abs);
|
|
1477
|
+
if (text !== null) {
|
|
1478
|
+
preferenceScreens.push(...attemptFact(unknowns, "stores", "store-collection-failed",
|
|
1479
|
+
() => (scanners.scanPreferenceScreen ?? scanPreferenceScreen)(text, rel), []));
|
|
1480
|
+
}
|
|
1481
|
+
continue;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
if (PROTO_RE.test(abs)) {
|
|
1485
|
+
const text = readText(abs);
|
|
1486
|
+
if (text === null) continue;
|
|
1487
|
+
entities.push(...attemptFact(unknowns, "entities", "entity-collection-failed",
|
|
1488
|
+
() => (scanners.scanProtoEntities ?? scanProtoEntities)(text, rel), []));
|
|
1489
|
+
endpoints.push(...attemptFact(unknowns, "endpoints", "endpoint-collection-failed",
|
|
1490
|
+
() => (scanners.scanProtoEndpoints ?? scanProtoEndpoints)(text, rel), []));
|
|
1491
|
+
continue;
|
|
1492
|
+
}
|
|
1493
|
+
// Nothing below reads anything but JVM and uni-app source, so other files are not opened.
|
|
1494
|
+
// Keep this condition aligned with the scanners' own predicates.
|
|
1495
|
+
if (!JVM_RE.test(abs) && !UI_SOURCE_RE.test(abs)) continue;
|
|
1496
|
+
const text = readText(abs);
|
|
1497
|
+
if (text === null) continue;
|
|
1498
|
+
|
|
1499
|
+
if (JVM_RE.test(abs)) {
|
|
1500
|
+
entities.push(...attemptFact(unknowns, "entities", "entity-collection-failed",
|
|
1501
|
+
() => (scanners.scanJvmEntities ?? scanJvmEntities)(text, rel), []));
|
|
1502
|
+
endpoints.push(...attemptFact(unknowns, "endpoints", "endpoint-collection-failed",
|
|
1503
|
+
() => (scanners.scanEndpoints ?? scanEndpoints)(text, rel), []));
|
|
1504
|
+
stores.push(...attemptFact(unknowns, "stores", "store-collection-failed",
|
|
1505
|
+
() => (scanners.scanStores ?? scanStores)(text, rel, receivers), []));
|
|
1506
|
+
continue;
|
|
1507
|
+
}
|
|
1508
|
+
// Everything below is the non-JVM half: uni-app sources. The scanners are language-shaped,
|
|
1509
|
+
// not platform-shaped: `uni.request({url, method})` states a request, and a literal storage
|
|
1510
|
+
// key is collected independently of the host platform.
|
|
1511
|
+
if (UI_SOURCE_RE.test(abs)) {
|
|
1512
|
+
endpoints.push(...attemptFact(unknowns, "endpoints", "endpoint-collection-failed",
|
|
1513
|
+
() => (scanners.scanUniEndpoints ?? scanUniEndpoints)(text, rel), []));
|
|
1514
|
+
stores.push(...attemptFact(unknowns, "stores", "store-collection-failed",
|
|
1515
|
+
() => (scanners.scanUniStores ?? scanUniStores)(text, rel), []));
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
// Preference screens -> stores. A key declared here wins over the same key found in code: the
|
|
1520
|
+
// XML carries the default and the complete enumeration, which code does not. An entry whose key
|
|
1521
|
+
// could not be resolved to a literal is `null` and contributes nothing.
|
|
1522
|
+
const prefStores = new Map();
|
|
1523
|
+
for (const pref of preferenceScreens) {
|
|
1524
|
+
const store = attemptFact(unknowns, "stores", "store-collection-failed",
|
|
1525
|
+
() => (scanners.preferenceStore ?? preferenceStore)(pref, strings, stringArrays), null);
|
|
1526
|
+
if (store !== null) prefStores.set(store.key, store);
|
|
1527
|
+
}
|
|
1528
|
+
// ONE entry per key. The same key is legitimately read and written from several files
|
|
1529
|
+
// (`saved_phone` in two login screens, `guide_shown` in splash and guide), and the per-file
|
|
1530
|
+
// scanner cannot know that. Merging here — after the walk, where every file has been seen — is
|
|
1531
|
+
// what keeps `stores.json` a key list rather than a call-site list. The FIRST file that names
|
|
1532
|
+
// the key wins, which is the sorted walk order, so the result does not depend on timing.
|
|
1533
|
+
const merged = new Map();
|
|
1534
|
+
const merge = (entry) => {
|
|
1535
|
+
const existing = merged.get(entry.key);
|
|
1536
|
+
if (existing === undefined) { merged.set(entry.key, entry); return; }
|
|
1537
|
+
// Fill blanks from a later sighting, never overwrite what is already known. A default found
|
|
1538
|
+
// anywhere is the app's default; conflicting defaults are invalid source, and picking the
|
|
1539
|
+
// first is a stated rule rather than an accident.
|
|
1540
|
+
if (existing.default === null && entry.default !== null && entry.default !== undefined) existing.default = entry.default;
|
|
1541
|
+
if (existing.type === "unknown" && entry.type !== "unknown") existing.type = entry.type;
|
|
1542
|
+
};
|
|
1543
|
+
for (const store of stores) merge(store);
|
|
1544
|
+
for (const store of prefStores.values()) merge(store);
|
|
1545
|
+
stores.length = 0;
|
|
1546
|
+
stores.push(...merged.values());
|
|
1547
|
+
|
|
1548
|
+
const sortedEntities = entities.sort((a, b) => (a.name === b.name ? a.file.localeCompare(b.file, "en") : a.name.localeCompare(b.name, "en")));
|
|
1549
|
+
const libs = attemptFact(unknowns, "libs", "libs-resolution-failed", () => {
|
|
1550
|
+
if (root === undefined) throw sourceError;
|
|
1551
|
+
return (scanners.resolveLibSources ?? resolveLibSources)(root, { gradleUserHome });
|
|
1552
|
+
}, []);
|
|
1553
|
+
|
|
1554
|
+
const symbols = attemptFact(unknowns, "symbols", "symbol-collection-failed", () => {
|
|
1555
|
+
const readableSymbolFiles = symbolFiles.filter((file) => fs.existsSync(file));
|
|
1556
|
+
return { symbols: [...(scanners.buildSymbolTable ?? buildSymbolTable)(readableSymbolFiles)].sort() };
|
|
1557
|
+
}, { symbols: [] });
|
|
1558
|
+
const enrichedEndpoints = attemptFact(unknowns, "endpoints", "endpoint-collection-failed",
|
|
1559
|
+
() => (scanners.attachResponseFields ?? attachResponseFields)(sortedEntities, endpoints), endpoints);
|
|
1560
|
+
|
|
1561
|
+
return {
|
|
1562
|
+
entities: sortedEntities,
|
|
1563
|
+
endpoints: enrichedEndpoints,
|
|
1564
|
+
stores: stores.sort((a, b) => a.key.localeCompare(b.key, "en")),
|
|
1565
|
+
strings: Object.fromEntries(Object.keys(strings).sort().map((k) => [k, strings[k]])),
|
|
1566
|
+
symbols,
|
|
1567
|
+
libs: {
|
|
1568
|
+
entries: libs,
|
|
1569
|
+
library_unavailable: libs.filter((e) => e.path === null).length,
|
|
1570
|
+
},
|
|
1571
|
+
unknowns: unknowns ?? [],
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
function factUnknown(operation, reason, error) {
|
|
1576
|
+
return {
|
|
1577
|
+
status: "partial",
|
|
1578
|
+
operation,
|
|
1579
|
+
reason,
|
|
1580
|
+
message: String(error?.message ?? error),
|
|
1581
|
+
next_action: "Inspect the source and rerun only the affected fact collection",
|
|
1582
|
+
};
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
/** Collect the complete in-memory fact base without creating output files. */
|
|
1586
|
+
export function collectFacts({ sourceProject, gradleUserHome = undefined, scanners = {} } = {}) {
|
|
1587
|
+
const unknowns = [];
|
|
1588
|
+
return collectFactsOrThrow({ sourceProject, gradleUserHome, unknowns, scanners });
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
/** Serialize the supplied in-memory value; never rescan or recompute facts. */
|
|
1592
|
+
export function writeFacts({ outDir, facts } = {}) {
|
|
1593
|
+
const factsDir = path.join(path.resolve(outDir), "facts");
|
|
1594
|
+
ensureDir(factsDir);
|
|
1595
|
+
writeJsonAtomic(path.join(factsDir, "entities.json"), facts.entities);
|
|
1596
|
+
writeJsonAtomic(path.join(factsDir, "endpoints.json"), facts.endpoints);
|
|
1597
|
+
writeJsonAtomic(path.join(factsDir, "stores.json"), facts.stores);
|
|
1598
|
+
writeJsonAtomic(path.join(factsDir, "strings.json"), facts.strings);
|
|
1599
|
+
writeJsonAtomic(path.join(factsDir, "symbols.json"), facts.symbols);
|
|
1600
|
+
writeJsonAtomic(path.join(factsDir, "libs.json"), facts.libs);
|
|
1601
|
+
const unknownsPath = path.join(factsDir, "unknowns.json");
|
|
1602
|
+
if (Array.isArray(facts.unknowns) && facts.unknowns.length > 0) {
|
|
1603
|
+
writeJsonAtomic(unknownsPath, facts.unknowns);
|
|
1604
|
+
} else {
|
|
1605
|
+
fs.rmSync(unknownsPath, { force: true });
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
/** Legacy throwing writer: existing consumers retain their warning fallback. */
|
|
1610
|
+
export function buildFacts({ sourceProject, outDir, gradleUserHome = undefined }) {
|
|
1611
|
+
const facts = collectFactsOrThrow({ sourceProject, gradleUserHome });
|
|
1612
|
+
writeFacts({ outDir, facts });
|
|
1613
|
+
}
|