@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,1542 @@
|
|
|
1
|
+
import { maskNonCode as sharedMaskNonCode } from "./lib/source-text.mjs";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { canonicalSourcePath, stableDigest } from "./behavior-model.mjs";
|
|
6
|
+
import { isExcludedEvidencePath } from "./facts-build.mjs";
|
|
7
|
+
import { openReadOnly } from "./lib/hg.mjs";
|
|
8
|
+
|
|
9
|
+
export { isExcludedEvidencePath } from "./facts-build.mjs";
|
|
10
|
+
|
|
11
|
+
const QUERY_LIMIT = 100;
|
|
12
|
+
const asArray = value => Array.isArray(value) ? value : [];
|
|
13
|
+
const nonEmpty = value => typeof value === "string" && value.trim() !== "";
|
|
14
|
+
const cmp = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
15
|
+
|
|
16
|
+
function ref(uri, start, end = start) {
|
|
17
|
+
return { uri, span: { start, end } };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function locatorOf(value) {
|
|
21
|
+
if (!nonEmpty(value)) return null;
|
|
22
|
+
const withoutSpan = value.replace(/:\d+(?:-\d+)?(?::\d+)?$/, "");
|
|
23
|
+
return withoutSpan.replace(/\\/g, "/");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function firstLocator(...values) {
|
|
27
|
+
for (const value of values) {
|
|
28
|
+
if (nonEmpty(value)) return locatorOf(value);
|
|
29
|
+
if (value && typeof value === "object") {
|
|
30
|
+
const nested = value.uri ?? value.locator ?? value.file_path ?? value.source_file ?? value.file;
|
|
31
|
+
if (nonEmpty(nested)) return locatorOf(nested);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function lineAt(text, offset) {
|
|
38
|
+
return text.slice(0, Math.max(0, offset)).split(/\r?\n/).length;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function lineRef(uri, text, start, end = start) {
|
|
42
|
+
return ref(uri, lineAt(text, start), lineAt(text, end));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Build and open a real HomeGraph index for a Vue SOURCE fixture. The caller
|
|
47
|
+
* owns the returned DB and the fixture lifecycle; no graph rows are synthesized.
|
|
48
|
+
*/
|
|
49
|
+
export function indexVueFixture({ sourceProject, spawnImpl = spawnSync } = {}) {
|
|
50
|
+
const partial = reason => ({ status: "partial", db: null, symbols: [], edges: [], reason });
|
|
51
|
+
if (!nonEmpty(sourceProject)) return partial("invalid-source-project");
|
|
52
|
+
let db = null;
|
|
53
|
+
try {
|
|
54
|
+
const windows = process.platform === "win32";
|
|
55
|
+
const command = windows ? (process.env.ComSpec ?? "cmd.exe") : "homegraph";
|
|
56
|
+
const args = windows ? ["/d", "/s", "/c", "homegraph", "init", sourceProject] : ["init", sourceProject];
|
|
57
|
+
const spawned = spawnImpl(command, args, {
|
|
58
|
+
encoding: "utf8",
|
|
59
|
+
timeout: 120_000,
|
|
60
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
61
|
+
shell: false,
|
|
62
|
+
windowsVerbatimArguments: false,
|
|
63
|
+
});
|
|
64
|
+
if (spawned?.error) return partial(`homegraph-init-failed: ${spawned.error.message}`);
|
|
65
|
+
if (spawned?.status !== 0) {
|
|
66
|
+
const detail = String(spawned?.stderr ?? spawned?.stdout ?? "").trim();
|
|
67
|
+
return partial(`homegraph-init-nonzero-exit${detail === "" ? "" : `: ${detail}`}`);
|
|
68
|
+
}
|
|
69
|
+
db = openReadOnly(sourceProject);
|
|
70
|
+
const symbols = db.prepare(`
|
|
71
|
+
SELECT id, kind, name, qualified_name, file_path, language
|
|
72
|
+
FROM nodes ORDER BY file_path ASC, name ASC, id ASC
|
|
73
|
+
`).all();
|
|
74
|
+
const edges = db.prepare(`
|
|
75
|
+
SELECT e.id, e.kind, e.line,
|
|
76
|
+
n1.id AS source_id, n1.name AS source_name,
|
|
77
|
+
n1.qualified_name AS source_qualified_name, n1.file_path AS source_file,
|
|
78
|
+
n2.id AS target_id, n2.name AS target_name,
|
|
79
|
+
n2.qualified_name AS target_qualified_name, n2.file_path AS target_file
|
|
80
|
+
FROM edges e
|
|
81
|
+
JOIN nodes n1 ON n1.id = e.source
|
|
82
|
+
JOIN nodes n2 ON n2.id = e.target
|
|
83
|
+
ORDER BY e.id ASC
|
|
84
|
+
`).all();
|
|
85
|
+
return { status: "resolved", db, symbols, edges, reason: null };
|
|
86
|
+
} catch (error) {
|
|
87
|
+
try { db?.close(); } catch { /* best-effort cleanup after a failed fixture build */ }
|
|
88
|
+
return partial(`homegraph-index-unavailable: ${error?.message ?? error}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function maskNonCode(text) {
|
|
93
|
+
return sharedMaskNonCode(text);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function matchingDelimiter(text, openIndex, open = "(", close = ")") {
|
|
97
|
+
let depth = 0;
|
|
98
|
+
let quote = null;
|
|
99
|
+
let escaped = false;
|
|
100
|
+
for (let index = openIndex; index < text.length; index += 1) {
|
|
101
|
+
const char = text[index];
|
|
102
|
+
if (quote !== null) {
|
|
103
|
+
if (escaped) escaped = false;
|
|
104
|
+
else if (char === "\\") escaped = true;
|
|
105
|
+
else if (char === quote) quote = null;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
109
|
+
quote = char;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
if (char === open) depth += 1;
|
|
113
|
+
if (char === close) {
|
|
114
|
+
depth -= 1;
|
|
115
|
+
if (depth === 0) return index;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return -1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function callArguments(callText) {
|
|
122
|
+
const open = callText.indexOf("(");
|
|
123
|
+
if (open === -1) return [];
|
|
124
|
+
const bodyStart = open + 1;
|
|
125
|
+
const body = callText.slice(bodyStart, callText.endsWith(")") ? -1 : undefined);
|
|
126
|
+
const args = [];
|
|
127
|
+
let depth = 0;
|
|
128
|
+
let quote = null;
|
|
129
|
+
let escaped = false;
|
|
130
|
+
let start = 0;
|
|
131
|
+
const push = end => {
|
|
132
|
+
const raw = body.slice(start, end);
|
|
133
|
+
const leading = raw.search(/\S/);
|
|
134
|
+
if (leading === -1) return;
|
|
135
|
+
args.push({ text: raw.trim(), offset: bodyStart + start + leading });
|
|
136
|
+
};
|
|
137
|
+
for (let index = 0; index < body.length; index += 1) {
|
|
138
|
+
const char = body[index];
|
|
139
|
+
if (quote !== null) {
|
|
140
|
+
if (escaped) escaped = false;
|
|
141
|
+
else if (char === "\\") escaped = true;
|
|
142
|
+
else if (char === quote) quote = null;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (char === '"' || char === "'" || char === "`") quote = char;
|
|
146
|
+
else if ("({[".includes(char)) depth += 1;
|
|
147
|
+
else if (")}]".includes(char)) depth -= 1;
|
|
148
|
+
else if (char === "," && depth === 0) {
|
|
149
|
+
push(index);
|
|
150
|
+
start = index + 1;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
push(body.length);
|
|
154
|
+
return args;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function declarationBefore(text, variable, before) {
|
|
158
|
+
const escaped = variable.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
159
|
+
const pattern = new RegExp(`\\b(?:const|let|var|val)\\s+${escaped}\\s*=`, "g");
|
|
160
|
+
let selected = null;
|
|
161
|
+
for (const match of text.slice(0, before).matchAll(pattern)) selected = match;
|
|
162
|
+
return selected === null ? null : { start: selected.index, endOfAssignment: selected.index + selected[0].length };
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function constructorFor({ uri, text, callStart, callEnd }) {
|
|
166
|
+
const call = text.slice(callStart, callEnd + 1);
|
|
167
|
+
const args = callArguments(call);
|
|
168
|
+
const callee = call.slice(0, call.indexOf("("));
|
|
169
|
+
// fetch's first argument is only the URL. Its request fields live in the
|
|
170
|
+
// options argument; treating the URL declaration as the constructor loses
|
|
171
|
+
// the values whose transmission the operation review must audit.
|
|
172
|
+
const argument = /\bfetch\s*$/.test(callee) && args.length > 1 ? args[1] : args[0];
|
|
173
|
+
if (argument === undefined) return lineRef(uri, text, callStart, callEnd + 1);
|
|
174
|
+
const argumentText = argument.text;
|
|
175
|
+
if (argumentText.startsWith("{")) {
|
|
176
|
+
const open = callStart + argument.offset;
|
|
177
|
+
const close = matchingDelimiter(text, open, "{", "}");
|
|
178
|
+
if (close !== -1) return lineRef(uri, text, open, close + 1);
|
|
179
|
+
}
|
|
180
|
+
if (/^[A-Za-z_$][\w$]*$/.test(argumentText)) {
|
|
181
|
+
const declaration = declarationBefore(text, argumentText, callStart);
|
|
182
|
+
if (declaration !== null) {
|
|
183
|
+
const valueStart = text.slice(declaration.endOfAssignment).search(/\S/);
|
|
184
|
+
const start = declaration.endOfAssignment + Math.max(0, valueStart);
|
|
185
|
+
if (text[start] === "{") {
|
|
186
|
+
const close = matchingDelimiter(text, start, "{", "}");
|
|
187
|
+
if (close !== -1) return lineRef(uri, text, declaration.start, close + 1);
|
|
188
|
+
}
|
|
189
|
+
const semicolon = text.indexOf(";", start);
|
|
190
|
+
const newline = text.indexOf("\n", start);
|
|
191
|
+
const callClose = matchingDelimiter(text, start, "(", ")");
|
|
192
|
+
const candidates = [semicolon, callClose === -1 ? -1 : callClose + 1, newline]
|
|
193
|
+
.filter(index => index !== -1 && index <= callStart);
|
|
194
|
+
const end = candidates.length > 0 ? Math.max(...candidates) : callStart;
|
|
195
|
+
return lineRef(uri, text, declaration.start, end);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// Arguments assembled at the call site are the real request constructor for
|
|
199
|
+
// Retrofit-style calls; never substitute the interface annotation location.
|
|
200
|
+
return lineRef(uri, text, callStart, callEnd + 1);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function functionWindow(text, sendEnd) {
|
|
204
|
+
const before = text.slice(0, sendEnd);
|
|
205
|
+
const starts = [...before.matchAll(/\b(?:export\s+)?(?:async\s+)?function\b|=>|\bfun\s+[A-Za-z_$]/g)];
|
|
206
|
+
const start = starts.length === 0 ? 0 : starts[starts.length - 1].index;
|
|
207
|
+
return { start, text: text.slice(start, sendEnd) };
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function stateReads(uri, text, start, end, callStart = start, maskedText = maskNonCode(text)) {
|
|
211
|
+
const window = functionWindow(text.slice(0, end), end - start);
|
|
212
|
+
const base = start + window.start;
|
|
213
|
+
const body = text.slice(base, end);
|
|
214
|
+
const reads = new Map();
|
|
215
|
+
const patterns = [
|
|
216
|
+
/\b(?:this\.)?(?:state|store|props|viewModel|model|input)\.([A-Za-z_$][\w$]*)/g,
|
|
217
|
+
/\b(?:state|store|input)\[\s*["']([A-Za-z_$][\w$-]*)["']\s*\]/g,
|
|
218
|
+
/\b(?:state|store|input)\.(?:get|getString|getInt|getBoolean|getLong)\(\s*["']([A-Za-z_$][\w$-]*)["']/g,
|
|
219
|
+
];
|
|
220
|
+
for (const pattern of patterns) {
|
|
221
|
+
for (const match of body.matchAll(pattern)) {
|
|
222
|
+
const line = lineAt(text, base + match.index);
|
|
223
|
+
reads.set(`${line}:${match[1]}`, ref(uri, line));
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const call = text.slice(callStart, end);
|
|
227
|
+
const argument = callArguments(call)[0];
|
|
228
|
+
if (argument !== undefined && requestClassName(text, callStart, end - 1) !== null) {
|
|
229
|
+
const maskedArgument = callArguments(maskedText.slice(callStart, end))[0];
|
|
230
|
+
const argumentOpen = maskedArgument?.text.indexOf("(") ?? -1;
|
|
231
|
+
const open = argumentOpen === -1 ? -1 : callStart + argument.offset + argumentOpen;
|
|
232
|
+
const close = open === -1 ? -1 : matchingDelimiter(maskedText, open);
|
|
233
|
+
const constructorCode = close === -1 ? "" : maskedText.slice(open, close + 1);
|
|
234
|
+
const namedArgument = /^(?:[A-Za-z_$][\w$]*)\s*=\s*(?:this\.)?([A-Za-z_$][\w$]*)$/;
|
|
235
|
+
for (const constructorArgument of callArguments(constructorCode)) {
|
|
236
|
+
const match = namedArgument.exec(constructorArgument.text.trim());
|
|
237
|
+
if (match === null || ["true", "false", "null", "undefined"].includes(match[1])) continue;
|
|
238
|
+
const valueOffset = constructorArgument.offset + constructorArgument.text.lastIndexOf(match[1]);
|
|
239
|
+
const line = lineAt(text, open + valueOffset);
|
|
240
|
+
reads.set(`${line}:${match[1]}`, ref(uri, line));
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return [...reads.values()].sort((a, b) => a.span.start - b.span.start || cmp(a.uri, b.uri));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function transforms(uri, text, start, end) {
|
|
247
|
+
const base = start + functionWindow(text.slice(0, end), end - start).start;
|
|
248
|
+
const body = text.slice(base, end);
|
|
249
|
+
const transforms = new Map();
|
|
250
|
+
const pattern = /\.(?:trim|toString|toInt|toDouble|toLong|toBoolean)\s*\(|\b(?:String|Number|Boolean|JSON\.stringify|encodeURIComponent|String\.valueOf|encode\w*)\s*\(/g;
|
|
251
|
+
for (const match of body.matchAll(pattern)) {
|
|
252
|
+
const line = lineAt(text, base + match.index);
|
|
253
|
+
transforms.set(line, ref(uri, line));
|
|
254
|
+
}
|
|
255
|
+
return [...transforms.values()].sort((a, b) => a.span.start - b.span.start);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function responseSpans(uri, text, sendEnd) {
|
|
259
|
+
const end = Math.min(text.length, sendEnd + 2500);
|
|
260
|
+
const body = text.slice(sendEnd, end);
|
|
261
|
+
const spans = [];
|
|
262
|
+
let offset = 0;
|
|
263
|
+
for (const line of body.split(/(?<=\n)/)) {
|
|
264
|
+
if (/\b(?:response|result|onSuccess|success)\b|\.data\b|\.then\s*\(|\bawait\b/.test(line)) {
|
|
265
|
+
spans.push(ref(uri, lineAt(text, sendEnd + offset)));
|
|
266
|
+
}
|
|
267
|
+
offset += line.length;
|
|
268
|
+
if (spans.length >= 20) break;
|
|
269
|
+
}
|
|
270
|
+
return spans;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function discoveryUnknown() {
|
|
274
|
+
return {
|
|
275
|
+
scope: "operation",
|
|
276
|
+
reason: "operation-discovery-partial",
|
|
277
|
+
next_action: "Re-run bounded HomeGraph callees discovery and inspect every unresolved request call site",
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function requestClassUnknown() {
|
|
282
|
+
return {
|
|
283
|
+
scope: "operation",
|
|
284
|
+
reason: "request-class-ambiguous",
|
|
285
|
+
next_action: "Disambiguate the request class by import and instantiates evidence",
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function requestClassName(text, callStart, callEnd) {
|
|
290
|
+
const call = text.slice(callStart, callEnd + 1);
|
|
291
|
+
const argument = callArguments(call)[0]?.text;
|
|
292
|
+
if (!nonEmpty(argument)) return null;
|
|
293
|
+
const constructor = /^(?:new\s+)?(?:[A-Za-z_$][\w$]*\.)*([A-Za-z_$][\w$]*)\s*\(/.exec(argument);
|
|
294
|
+
return constructor?.[1] ?? null;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function primaryConstructorSpan(uri, text, className, startLine, maskedText = maskNonCode(text)) {
|
|
298
|
+
if (!Number.isInteger(startLine) || startLine < 1) return null;
|
|
299
|
+
const lineStart = offsetAtLine(text, startLine);
|
|
300
|
+
if (lineStart === Number.MAX_SAFE_INTEGER) return null;
|
|
301
|
+
const escaped = className.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
302
|
+
const declaration = new RegExp(`\\b(?:data\\s+|value\\s+)?class\\s+${escaped}\\b\\s*(?:constructor\\s*)?\\(`)
|
|
303
|
+
.exec(maskedText.slice(lineStart));
|
|
304
|
+
if (declaration === null) return null;
|
|
305
|
+
const declarationLine = lineAt(text, lineStart + declaration.index);
|
|
306
|
+
if (declarationLine !== startLine) {
|
|
307
|
+
const annotation = maskedText.slice(lineStart, lineStart + declaration.index);
|
|
308
|
+
const attachedAnnotation = declarationLine === startLine + 1
|
|
309
|
+
&& /^\s*@[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*(?:\s*\([^\r\n]*\))?\s*$/.test(annotation);
|
|
310
|
+
if (!attachedAnnotation) return null;
|
|
311
|
+
}
|
|
312
|
+
const open = lineStart + declaration.index + declaration[0].lastIndexOf("(");
|
|
313
|
+
const close = matchingDelimiter(maskedText, open);
|
|
314
|
+
return close === -1 ? null : lineRef(uri, text, lineStart + declaration.index, close + 1);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function requestEncoding({ db, readSource, readMaskedSource = null, uri, text, callStart, callEnd, callerNode = null }) {
|
|
318
|
+
const className = requestClassName(text, callStart, callEnd);
|
|
319
|
+
if (className === null || !db || typeof db.prepare !== "function" || typeof readSource !== "function") {
|
|
320
|
+
return { span: null, partial: false };
|
|
321
|
+
}
|
|
322
|
+
let rows;
|
|
323
|
+
try {
|
|
324
|
+
rows = db.prepare(`
|
|
325
|
+
SELECT id, file_path, start_line FROM nodes
|
|
326
|
+
WHERE kind IN ('class', 'struct') AND name = ?
|
|
327
|
+
ORDER BY file_path ASC, id ASC
|
|
328
|
+
`).all(className);
|
|
329
|
+
} catch {
|
|
330
|
+
return { span: null, partial: true };
|
|
331
|
+
}
|
|
332
|
+
if (!Array.isArray(rows)) return { span: null, partial: true };
|
|
333
|
+
if (rows.length === 0) return { span: null, partial: false };
|
|
334
|
+
let selected = rows[0];
|
|
335
|
+
if (rows.length > 1) {
|
|
336
|
+
let instantiated = [];
|
|
337
|
+
if (callerNode !== null) {
|
|
338
|
+
try {
|
|
339
|
+
const classIds = new Set(rows.map(row => row.id));
|
|
340
|
+
const edges = db.prepare(`
|
|
341
|
+
SELECT target FROM edges WHERE source = ? AND kind = 'instantiates' ORDER BY id ASC
|
|
342
|
+
`).all(callerNode.id);
|
|
343
|
+
instantiated = [...new Set(edges.map(edge => edge.target).filter(target => classIds.has(target)))];
|
|
344
|
+
} catch {
|
|
345
|
+
return { span: null, partial: true };
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
if (instantiated.length !== 1) {
|
|
349
|
+
return { span: null, partial: true, unknown: requestClassUnknown() };
|
|
350
|
+
}
|
|
351
|
+
selected = rows.find(row => row.id === instantiated[0]);
|
|
352
|
+
}
|
|
353
|
+
const classUri = firstLocator(selected.file_path);
|
|
354
|
+
if (classUri === null || isExcludedEvidencePath(classUri)) return { span: null, partial: true };
|
|
355
|
+
let classText;
|
|
356
|
+
try {
|
|
357
|
+
classText = readSource(classUri);
|
|
358
|
+
} catch {
|
|
359
|
+
return { span: null, partial: true };
|
|
360
|
+
}
|
|
361
|
+
if (classText === null) return { span: null, partial: true };
|
|
362
|
+
const classMaskedText = typeof readMaskedSource === "function"
|
|
363
|
+
? readMaskedSource(classUri) : maskNonCode(classText);
|
|
364
|
+
const span = primaryConstructorSpan(classUri, classText, className, selected.start_line, classMaskedText);
|
|
365
|
+
return { span, partial: span === null };
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function candidateFromCall({
|
|
369
|
+
page, uri, text, callStart, callEnd, partial = false, db = null,
|
|
370
|
+
readSource = null, readMaskedSource = null, maskedText = undefined, callerNode = null,
|
|
371
|
+
}) {
|
|
372
|
+
const constructor = constructorFor({ uri, text, callStart, callEnd });
|
|
373
|
+
const stateStart = Math.max(0, callStart - 8000);
|
|
374
|
+
const stateReadSpans = stateReads(uri, text, stateStart, callEnd + 1, callStart, maskedText);
|
|
375
|
+
const transformSpans = transforms(uri, text, stateStart, callEnd + 1);
|
|
376
|
+
const send = lineRef(uri, text, callStart, callEnd + 1);
|
|
377
|
+
const encoding = requestEncoding({ db, readSource, readMaskedSource, uri, text, callStart, callEnd, callerNode });
|
|
378
|
+
const isPartial = partial || encoding.partial;
|
|
379
|
+
const identity = {
|
|
380
|
+
page_id: page.page_id,
|
|
381
|
+
constructor_span: constructor,
|
|
382
|
+
send_span: send,
|
|
383
|
+
};
|
|
384
|
+
return {
|
|
385
|
+
operation_id: `op_${stableDigest(identity)}`,
|
|
386
|
+
constructor_span: constructor,
|
|
387
|
+
state_read_spans: stateReadSpans,
|
|
388
|
+
transform_spans: transformSpans,
|
|
389
|
+
encode_span: encoding.span ?? constructor,
|
|
390
|
+
send_span: send,
|
|
391
|
+
response_spans: responseSpans(uri, text, callEnd + 1),
|
|
392
|
+
status: isPartial ? "partial" : "discovered",
|
|
393
|
+
unknown: isPartial ? (encoding.unknown ?? discoveryUnknown()) : null,
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function partialCandidate(page) {
|
|
398
|
+
const operationId = `op_${stableDigest({ page_id: page.page_id, reason: "operation-discovery-partial" })}`;
|
|
399
|
+
return {
|
|
400
|
+
operation_id: operationId,
|
|
401
|
+
// No source-backed call was discovered. Null locations are intentional:
|
|
402
|
+
// fabricating a page declaration as a constructor/send would be worse than
|
|
403
|
+
// carrying this explicit, unauditable operation forward as an unknown.
|
|
404
|
+
constructor_span: null,
|
|
405
|
+
state_read_spans: [],
|
|
406
|
+
transform_spans: [],
|
|
407
|
+
encode_span: null,
|
|
408
|
+
send_span: null,
|
|
409
|
+
response_spans: [],
|
|
410
|
+
status: "partial",
|
|
411
|
+
unknown: discoveryUnknown(),
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function isDeclaration(line, name) {
|
|
416
|
+
if (new RegExp(`\\b(?:function|fun)\\s+${name}\\s*\\(|\\binterface\\s+\\w+|@(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\\b`).test(line)) {
|
|
417
|
+
return true;
|
|
418
|
+
}
|
|
419
|
+
// Java declarations have a return type before the method name and terminate
|
|
420
|
+
// their signature with ';'. Statement keywords are not return types: an
|
|
421
|
+
// unqualified invocation such as `return getGoodsPage(request);` is a call.
|
|
422
|
+
return new RegExp(
|
|
423
|
+
`^\\s*(?:(?:public|protected|private|abstract|static|final|synchronized|native|default|strictfp)\\s+)*` +
|
|
424
|
+
`(?!(?:return|throw|yield|else|do|assert)\\s+)` +
|
|
425
|
+
`[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*(?:\\s*<[^;{}]*>)?(?:\\s*\\[\\s*\\])*` +
|
|
426
|
+
`\\s+${name}\\s*\\([^;{}]*\\)\\s*(?:throws\\s+[^;{}]+)?;\\s*$`,
|
|
427
|
+
).test(line);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
function directCalls({ text, endpoint, maskedText = maskNonCode(text) }) {
|
|
431
|
+
const calls = [];
|
|
432
|
+
const scanText = maskedText;
|
|
433
|
+
if (nonEmpty(endpoint?.function)) {
|
|
434
|
+
const name = endpoint.function.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
435
|
+
const pattern = new RegExp(`\\b${name}\\s*\\(`, "g");
|
|
436
|
+
for (const match of scanText.matchAll(pattern)) {
|
|
437
|
+
const open = scanText.indexOf("(", match.index);
|
|
438
|
+
const close = matchingDelimiter(scanText, open);
|
|
439
|
+
if (close === -1) continue;
|
|
440
|
+
const lineStart = scanText.lastIndexOf("\n", match.index) + 1;
|
|
441
|
+
const lineEnd = scanText.indexOf("\n", close);
|
|
442
|
+
const signature = scanText.slice(lineStart, lineEnd === -1 ? scanText.length : lineEnd);
|
|
443
|
+
if (isDeclaration(signature, endpoint.function)) continue;
|
|
444
|
+
calls.push({ start: match.index, end: close });
|
|
445
|
+
}
|
|
446
|
+
return calls;
|
|
447
|
+
}
|
|
448
|
+
const okHttp = /\.newCall\s*\(/g;
|
|
449
|
+
for (const match of scanText.matchAll(okHttp)) {
|
|
450
|
+
const newCallOpen = scanText.indexOf("(", match.index);
|
|
451
|
+
const newCallClose = matchingDelimiter(scanText, newCallOpen);
|
|
452
|
+
if (newCallClose === -1) continue;
|
|
453
|
+
const tail = /^\s*\.\s*(?:execute|enqueue)\s*\(/.exec(scanText.slice(newCallClose + 1));
|
|
454
|
+
if (tail === null) continue;
|
|
455
|
+
const sendOpen = newCallClose + 1 + tail[0].lastIndexOf("(");
|
|
456
|
+
const sendClose = matchingDelimiter(scanText, sendOpen);
|
|
457
|
+
if (sendClose !== -1) calls.push({ start: match.index, end: sendClose });
|
|
458
|
+
}
|
|
459
|
+
const patterns = [
|
|
460
|
+
/\buni\s*\.\s*request\s*\(/g,
|
|
461
|
+
/\bfetch\s*\(/g,
|
|
462
|
+
/\baxios\s*\(/g,
|
|
463
|
+
];
|
|
464
|
+
for (const pattern of patterns) {
|
|
465
|
+
for (const match of scanText.matchAll(pattern)) {
|
|
466
|
+
const open = scanText.indexOf("(", match.index);
|
|
467
|
+
const close = matchingDelimiter(scanText, open);
|
|
468
|
+
if (close !== -1) calls.push({ start: match.index, end: close });
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return calls;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function footprintEntryOf(footprint, pageId) {
|
|
475
|
+
if (footprint instanceof Map) return footprint.get(pageId);
|
|
476
|
+
return footprint?.[pageId];
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* The footprint owns sourceProject-relative paths. In particular, a nested
|
|
481
|
+
* UniApp UTG node's source_file is app-root-relative and must never become a
|
|
482
|
+
* top-level read fallback once a footprint entry exists.
|
|
483
|
+
*/
|
|
484
|
+
function operationPageOf(page, footprint) {
|
|
485
|
+
const entry = footprintEntryOf(footprint, page.page_id);
|
|
486
|
+
if (entry === undefined || entry === null) {
|
|
487
|
+
return { page, entrypointFiles: [firstLocator(page.source_file, page.declared_at)].filter(nonEmpty) };
|
|
488
|
+
}
|
|
489
|
+
const resolvedFile = firstLocator(entry.resolvedFile);
|
|
490
|
+
const originUnits = asArray(entry.origin_units);
|
|
491
|
+
const sourceOrigins = originUnits.map(unit => ({
|
|
492
|
+
...(unit?.origin ?? {}),
|
|
493
|
+
declared_at: firstLocator(unit?.resolvedFile),
|
|
494
|
+
source_file: firstLocator(unit?.resolvedFile),
|
|
495
|
+
}));
|
|
496
|
+
const fullFiles = new Set([
|
|
497
|
+
resolvedFile,
|
|
498
|
+
...(entry.all instanceof Set ? [...entry.all] : asArray(entry.all)).map(value => firstLocator(value)),
|
|
499
|
+
...originUnits.map(unit => firstLocator(unit?.resolvedFile)),
|
|
500
|
+
].filter(nonEmpty));
|
|
501
|
+
const sourceFileMap = new Map();
|
|
502
|
+
const primarySourceFile = firstLocator(page.source_file);
|
|
503
|
+
if (primarySourceFile !== null) sourceFileMap.set(primarySourceFile, resolvedFile);
|
|
504
|
+
const originalOrigins = new Map(asArray(page.source_origins).map(origin => [origin?.page_id, origin]));
|
|
505
|
+
for (const unit of originUnits) {
|
|
506
|
+
const original = originalOrigins.get(unit?.origin?.page_id);
|
|
507
|
+
const appRelative = firstLocator(original?.source_file);
|
|
508
|
+
if (appRelative !== null) sourceFileMap.set(appRelative, firstLocator(unit?.resolvedFile));
|
|
509
|
+
}
|
|
510
|
+
const declaredFiles = new Set([
|
|
511
|
+
firstLocator(page.declared_at),
|
|
512
|
+
...asArray(page.source_origins).map(origin => firstLocator(origin?.declared_at)),
|
|
513
|
+
].filter(nonEmpty));
|
|
514
|
+
|
|
515
|
+
let appRootPrefix = null;
|
|
516
|
+
if (resolvedFile !== null && primarySourceFile !== null) {
|
|
517
|
+
if (resolvedFile === primarySourceFile) appRootPrefix = "";
|
|
518
|
+
else if (resolvedFile.endsWith(`/${primarySourceFile}`)) {
|
|
519
|
+
appRootPrefix = resolvedFile.slice(0, -primarySourceFile.length - 1);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
const resolveLocator = value => {
|
|
523
|
+
const locator = firstLocator(value);
|
|
524
|
+
if (locator === null) return null;
|
|
525
|
+
if (sourceFileMap.has(locator)) return sourceFileMap.get(locator);
|
|
526
|
+
if (fullFiles.has(locator) || declaredFiles.has(locator)) return locator;
|
|
527
|
+
if (appRootPrefix !== null) {
|
|
528
|
+
if (appRootPrefix === "" || locator.startsWith(`${appRootPrefix}/`)) return locator;
|
|
529
|
+
return path.posix.normalize(path.posix.join(appRootPrefix, locator));
|
|
530
|
+
}
|
|
531
|
+
const suffixHits = [...fullFiles].filter(file => file.endsWith(`/${locator}`));
|
|
532
|
+
if (suffixHits.length === 1) return suffixHits[0];
|
|
533
|
+
if (suffixHits.length > 1) return null;
|
|
534
|
+
return locator;
|
|
535
|
+
};
|
|
536
|
+
return {
|
|
537
|
+
page: {
|
|
538
|
+
...page,
|
|
539
|
+
declared_at: resolvedFile,
|
|
540
|
+
source_file: resolvedFile,
|
|
541
|
+
source_origins: sourceOrigins,
|
|
542
|
+
},
|
|
543
|
+
entrypointFiles: resolvedFile === null ? [] : [resolvedFile],
|
|
544
|
+
resolveLocator,
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
function pageLocators(page, entryRecord, resolveLocator = null) {
|
|
549
|
+
const locators = new Set();
|
|
550
|
+
const add = value => {
|
|
551
|
+
const locator = firstLocator(value);
|
|
552
|
+
const resolved = resolveLocator === null ? locator : resolveLocator(locator);
|
|
553
|
+
if (resolved !== null && !isExcludedEvidencePath(resolved)) locators.add(resolved);
|
|
554
|
+
};
|
|
555
|
+
add(page.declared_at);
|
|
556
|
+
add(page.source_file);
|
|
557
|
+
for (const origin of asArray(page.source_origins)) {
|
|
558
|
+
add(origin.declared_at);
|
|
559
|
+
add(origin.source_file);
|
|
560
|
+
}
|
|
561
|
+
for (const edge of [...asArray(page.out_edges), ...asArray(page.behavior_edges)]) {
|
|
562
|
+
add(edge.trigger);
|
|
563
|
+
add(edge.at);
|
|
564
|
+
}
|
|
565
|
+
for (const locator of [...asArray(entryRecord?.requiredLocators), ...asArray(entryRecord?.required_locators)]) add(locator);
|
|
566
|
+
for (const candidate of asArray(entryRecord?.candidates)) {
|
|
567
|
+
add(candidate.trigger?.producer_file);
|
|
568
|
+
add(candidate.trigger?.callsite);
|
|
569
|
+
for (const reference of asArray(candidate.evidence_refs)) add(reference);
|
|
570
|
+
}
|
|
571
|
+
return locators;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
function queryCalls({ page, endpoints, query }) {
|
|
575
|
+
if (typeof query !== "function") return { items: [], partial: false };
|
|
576
|
+
const symbol = [page.fqn, page.qualified_name, page.label,
|
|
577
|
+
nonEmpty(page.page_id) ? page.page_id.replace(/^[^:]*:/, "") : null].find(nonEmpty);
|
|
578
|
+
if (!symbol) return { items: [], partial: false };
|
|
579
|
+
try {
|
|
580
|
+
const result = query({ command: "callees", symbol, limit: QUERY_LIMIT });
|
|
581
|
+
return {
|
|
582
|
+
items: asArray(result?.items),
|
|
583
|
+
partial: result?.status !== "ok" || result?.truncated === true,
|
|
584
|
+
};
|
|
585
|
+
} catch {
|
|
586
|
+
return { items: [], partial: true };
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
function dbCalls({ page, db }) {
|
|
591
|
+
if (!db || typeof db.prepare !== "function") return { items: [], partial: false };
|
|
592
|
+
const labels = [...new Set([page.label, page.fqn, page.qualified_name,
|
|
593
|
+
nonEmpty(page.page_id) ? page.page_id.replace(/^[^:]*:/, "") : null].filter(nonEmpty))];
|
|
594
|
+
const items = [];
|
|
595
|
+
try {
|
|
596
|
+
const sources = db.prepare("SELECT id FROM nodes WHERE name = ? OR qualified_name = ? ORDER BY id ASC");
|
|
597
|
+
const calls = db.prepare(`
|
|
598
|
+
SELECT n2.name AS name, n2.qualified_name AS qualified_name,
|
|
599
|
+
n1.file_path AS file_path, e.line AS line, e.kind AS edge_kind
|
|
600
|
+
FROM edges e JOIN nodes n1 ON n1.id = e.source JOIN nodes n2 ON n2.id = e.target
|
|
601
|
+
WHERE e.source = ? AND e.kind IN ('calls', 'instantiates', 'references')
|
|
602
|
+
ORDER BY e.line ASC, e.id ASC
|
|
603
|
+
`);
|
|
604
|
+
for (const label of labels) {
|
|
605
|
+
for (const source of sources.all(label, label)) items.push(...calls.all(source.id));
|
|
606
|
+
}
|
|
607
|
+
} catch {
|
|
608
|
+
// A failed graph read is missing evidence, not an empty call list: the page
|
|
609
|
+
// must stay partial instead of publishing "no operations".
|
|
610
|
+
return { items: [], partial: true };
|
|
611
|
+
}
|
|
612
|
+
return { items, partial: false };
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
function graphLocators(items) {
|
|
616
|
+
const locators = new Set();
|
|
617
|
+
for (const item of items) {
|
|
618
|
+
const locator = firstLocator(item, item?.caller, item?.source, item?.callsite, item?.call_site);
|
|
619
|
+
if (locator !== null && !isExcludedEvidencePath(locator)) locators.add(locator);
|
|
620
|
+
}
|
|
621
|
+
return locators;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
const OPERATION_FUNCTION_KINDS = new Set(["function", "method"]);
|
|
625
|
+
const OPERATION_CLASS_KINDS = new Set(["class", "interface", "struct"]);
|
|
626
|
+
const OPERATION_REACH_LIMIT = 500;
|
|
627
|
+
|
|
628
|
+
/** Resolve callable ownership without promoting file/class reachability to method reachability. */
|
|
629
|
+
function operationFunctionGraph({ page, db }) {
|
|
630
|
+
const reachable = new Set();
|
|
631
|
+
let failed = false;
|
|
632
|
+
const empty = {
|
|
633
|
+
reachable,
|
|
634
|
+
enclosingNode: () => null,
|
|
635
|
+
get partial() { return failed; },
|
|
636
|
+
};
|
|
637
|
+
if (!db || typeof db.prepare !== "function") return empty;
|
|
638
|
+
let seeds;
|
|
639
|
+
let declaredSeed;
|
|
640
|
+
let outgoing;
|
|
641
|
+
let enclosing;
|
|
642
|
+
try {
|
|
643
|
+
seeds = db.prepare(`
|
|
644
|
+
SELECT id FROM nodes
|
|
645
|
+
WHERE (name = ? OR qualified_name = ?)
|
|
646
|
+
AND kind IN ('function', 'method', 'class', 'interface', 'struct')
|
|
647
|
+
ORDER BY id ASC
|
|
648
|
+
`);
|
|
649
|
+
declaredSeed = db.prepare(`
|
|
650
|
+
SELECT id FROM nodes
|
|
651
|
+
WHERE file_path = ? AND start_line = ?
|
|
652
|
+
AND kind IN ('function', 'method', 'class', 'interface', 'struct')
|
|
653
|
+
ORDER BY id ASC
|
|
654
|
+
`);
|
|
655
|
+
outgoing = db.prepare(`
|
|
656
|
+
SELECT e.target AS target, e.kind AS kind,
|
|
657
|
+
n1.kind AS source_kind, n2.kind AS target_kind
|
|
658
|
+
FROM edges e
|
|
659
|
+
JOIN nodes n1 ON n1.id = e.source
|
|
660
|
+
JOIN nodes n2 ON n2.id = e.target
|
|
661
|
+
WHERE e.source = ?
|
|
662
|
+
AND e.kind IN ('calls', 'instantiates', 'extends', 'implements', 'contains')
|
|
663
|
+
ORDER BY e.id ASC
|
|
664
|
+
`);
|
|
665
|
+
enclosing = db.prepare(`
|
|
666
|
+
SELECT id, kind, name, qualified_name, file_path, start_line FROM nodes
|
|
667
|
+
WHERE file_path = ? AND kind IN ('function', 'method')
|
|
668
|
+
AND start_line IS NOT NULL AND start_line <= ?
|
|
669
|
+
ORDER BY start_line DESC, id ASC
|
|
670
|
+
LIMIT 1
|
|
671
|
+
`);
|
|
672
|
+
} catch {
|
|
673
|
+
failed = true;
|
|
674
|
+
return empty;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
const queue = [];
|
|
678
|
+
const enqueue = id => {
|
|
679
|
+
if (!nonEmpty(id) || reachable.has(id) || reachable.size >= OPERATION_REACH_LIMIT) return;
|
|
680
|
+
reachable.add(id);
|
|
681
|
+
queue.push(id);
|
|
682
|
+
};
|
|
683
|
+
const labels = [...new Set([page.label, page.fqn, page.qualified_name,
|
|
684
|
+
nonEmpty(page.page_id) ? page.page_id.replace(/^[^:]*:/, "") : null].filter(nonEmpty))];
|
|
685
|
+
try {
|
|
686
|
+
for (const label of labels) {
|
|
687
|
+
for (const row of seeds.all(label, label)) enqueue(row.id);
|
|
688
|
+
}
|
|
689
|
+
const declaredFile = firstLocator(page.declared_at, page.source_file);
|
|
690
|
+
const declaredLine = /:(\d+)(?:-\d+)?$/.exec(String(page.declared_at ?? ""))?.[1];
|
|
691
|
+
if (declaredFile !== null && declaredLine !== undefined) {
|
|
692
|
+
for (const row of declaredSeed.all(declaredFile, Number(declaredLine))) enqueue(row.id);
|
|
693
|
+
}
|
|
694
|
+
let traversed = 0;
|
|
695
|
+
while (queue.length > 0 && traversed < OPERATION_REACH_LIMIT) {
|
|
696
|
+
const source = queue.shift();
|
|
697
|
+
for (const row of outgoing.all(source)) {
|
|
698
|
+
if (row.kind === "contains"
|
|
699
|
+
&& (!OPERATION_FUNCTION_KINDS.has(row.source_kind) || !OPERATION_CLASS_KINDS.has(row.target_kind))) {
|
|
700
|
+
continue;
|
|
701
|
+
}
|
|
702
|
+
enqueue(row.target);
|
|
703
|
+
traversed += 1;
|
|
704
|
+
if (traversed >= OPERATION_REACH_LIMIT) break;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
} catch {
|
|
708
|
+
// Original page/entry/graph evidence remains usable without this extra gate,
|
|
709
|
+
// but the missing ownership/reachability is still missing evidence.
|
|
710
|
+
failed = true;
|
|
711
|
+
}
|
|
712
|
+
return {
|
|
713
|
+
reachable,
|
|
714
|
+
get partial() { return failed; },
|
|
715
|
+
enclosingNode(uri, callStart, text) {
|
|
716
|
+
try {
|
|
717
|
+
return enclosing.get(uri, lineAt(text, callStart)) ?? null;
|
|
718
|
+
} catch {
|
|
719
|
+
failed = true;
|
|
720
|
+
return null;
|
|
721
|
+
}
|
|
722
|
+
},
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// ---------------------------------------------------------------------------
|
|
727
|
+
// UniApp SOURCE operations: real HomeGraph paths plus literal request mutations
|
|
728
|
+
// ---------------------------------------------------------------------------
|
|
729
|
+
|
|
730
|
+
const UNI_GRAPH_EDGE_KINDS = new Set(["calls", "imports", "references", "instantiates"]);
|
|
731
|
+
const UNI_GRAPH_LIMIT = 500;
|
|
732
|
+
|
|
733
|
+
function graphNode(row) {
|
|
734
|
+
return {
|
|
735
|
+
id: row.id,
|
|
736
|
+
kind: row.kind,
|
|
737
|
+
name: row.name,
|
|
738
|
+
qualified_name: row.qualified_name,
|
|
739
|
+
file_path: firstLocator(row.file_path),
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/** Traverse declarations and module-level call sites from the page's real file nodes. */
|
|
744
|
+
function traverseUniGraph(db, seedFiles) {
|
|
745
|
+
if (!db || typeof db.prepare !== "function") return { files: new Set(), nodes: new Map(), edges: [], paths: new Map(), partial: true };
|
|
746
|
+
const nodes = new Map();
|
|
747
|
+
const edges = [];
|
|
748
|
+
const paths = new Map();
|
|
749
|
+
const files = new Set();
|
|
750
|
+
const visitedFiles = new Set();
|
|
751
|
+
const queue = [];
|
|
752
|
+
let partial = false;
|
|
753
|
+
let nodesInFile;
|
|
754
|
+
let outgoing;
|
|
755
|
+
try {
|
|
756
|
+
nodesInFile = db.prepare(`
|
|
757
|
+
SELECT id, kind, name, qualified_name, file_path
|
|
758
|
+
FROM nodes WHERE file_path = ?
|
|
759
|
+
ORDER BY CASE WHEN kind = 'file' THEN 0 ELSE 1 END, id ASC
|
|
760
|
+
`);
|
|
761
|
+
outgoing = db.prepare(`
|
|
762
|
+
SELECT e.id, e.kind, e.line,
|
|
763
|
+
n1.id AS source_id, n1.kind AS source_kind, n1.name AS source_name,
|
|
764
|
+
n1.qualified_name AS source_qualified_name, n1.file_path AS source_file,
|
|
765
|
+
n2.id AS target_id, n2.kind AS target_kind, n2.name AS target_name,
|
|
766
|
+
n2.qualified_name AS target_qualified_name, n2.file_path AS target_file
|
|
767
|
+
FROM edges e
|
|
768
|
+
JOIN nodes n1 ON n1.id = e.source
|
|
769
|
+
JOIN nodes n2 ON n2.id = e.target
|
|
770
|
+
WHERE e.source = ? AND e.kind IN ('calls', 'imports', 'references', 'instantiates')
|
|
771
|
+
ORDER BY e.line ASC, e.id ASC
|
|
772
|
+
`);
|
|
773
|
+
} catch {
|
|
774
|
+
return { files, nodes, edges, paths, partial: true };
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
const enqueueNode = (row, pathNames) => {
|
|
778
|
+
if (!row?.id || nodes.has(row.id)) return;
|
|
779
|
+
const node = graphNode(row);
|
|
780
|
+
if (node.file_path !== null && isExcludedEvidencePath(node.file_path)) return;
|
|
781
|
+
nodes.set(node.id, node);
|
|
782
|
+
paths.set(node.id, pathNames);
|
|
783
|
+
queue.push(node);
|
|
784
|
+
};
|
|
785
|
+
const enqueueFile = file => {
|
|
786
|
+
if (!nonEmpty(file) || isExcludedEvidencePath(file) || visitedFiles.has(file)) return;
|
|
787
|
+
visitedFiles.add(file);
|
|
788
|
+
files.add(file);
|
|
789
|
+
const rows = nodesInFile.all(file);
|
|
790
|
+
if (rows.length === 0) return;
|
|
791
|
+
// A module's file node owns top-level wrapper/interceptor calls. Function
|
|
792
|
+
// nodes reached from it carry their own ordered call path.
|
|
793
|
+
const fileNode = rows.find(row => row.kind === "file");
|
|
794
|
+
for (const row of fileNode ? [fileNode] : rows) enqueueNode(row, []);
|
|
795
|
+
};
|
|
796
|
+
for (const file of [...seedFiles].sort(cmp)) enqueueFile(file);
|
|
797
|
+
|
|
798
|
+
while (queue.length > 0) {
|
|
799
|
+
if (edges.length >= UNI_GRAPH_LIMIT) {
|
|
800
|
+
partial = true;
|
|
801
|
+
break;
|
|
802
|
+
}
|
|
803
|
+
const source = queue.shift();
|
|
804
|
+
for (const row of outgoing.all(source.id)) {
|
|
805
|
+
if (!UNI_GRAPH_EDGE_KINDS.has(row.kind)) continue;
|
|
806
|
+
const edge = {
|
|
807
|
+
id: row.id, kind: row.kind, line: row.line,
|
|
808
|
+
source_id: row.source_id, source_name: row.source_name,
|
|
809
|
+
source_qualified_name: row.source_qualified_name,
|
|
810
|
+
source_file: firstLocator(row.source_file),
|
|
811
|
+
target_id: row.target_id, target_name: row.target_name,
|
|
812
|
+
target_qualified_name: row.target_qualified_name,
|
|
813
|
+
target_file: firstLocator(row.target_file),
|
|
814
|
+
};
|
|
815
|
+
edges.push(edge);
|
|
816
|
+
if (edge.target_file === null || isExcludedEvidencePath(edge.target_file)) continue;
|
|
817
|
+
const sourcePath = paths.get(source.id) ?? [];
|
|
818
|
+
const nextPath = source.kind === "file" ? sourcePath : [...sourcePath];
|
|
819
|
+
// Imports/references open the target module for source discovery, but they
|
|
820
|
+
// are not an invoked call-path step. Only an actual call names the wrapper
|
|
821
|
+
// chain whose constructor and ordering this operation claims.
|
|
822
|
+
if (edge.kind === "calls" && !nodes.has(row.target_id)) {
|
|
823
|
+
enqueueNode({
|
|
824
|
+
id: row.target_id, kind: row.target_kind, name: row.target_name,
|
|
825
|
+
qualified_name: row.target_qualified_name, file_path: row.target_file,
|
|
826
|
+
}, row.target_kind === "file" ? nextPath : [...nextPath, {
|
|
827
|
+
name: row.target_name,
|
|
828
|
+
uri: row.target_file,
|
|
829
|
+
line: row.line ?? null,
|
|
830
|
+
}]);
|
|
831
|
+
}
|
|
832
|
+
if (!visitedFiles.has(edge.target_file)) enqueueFile(edge.target_file);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
return { files, nodes, edges, paths, partial };
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
function splitLiteral(text, separator = ",") {
|
|
839
|
+
const parts = [];
|
|
840
|
+
let start = 0;
|
|
841
|
+
let depth = 0;
|
|
842
|
+
let quote = null;
|
|
843
|
+
let escaped = false;
|
|
844
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
845
|
+
const char = text[index];
|
|
846
|
+
if (quote !== null) {
|
|
847
|
+
if (escaped) escaped = false;
|
|
848
|
+
else if (char === "\\") escaped = true;
|
|
849
|
+
else if (char === quote) quote = null;
|
|
850
|
+
continue;
|
|
851
|
+
}
|
|
852
|
+
if (char === '"' || char === "'" || char === "`") quote = char;
|
|
853
|
+
else if ("({[".includes(char)) depth += 1;
|
|
854
|
+
else if (")}]".includes(char)) depth -= 1;
|
|
855
|
+
else if (char === separator && depth === 0) {
|
|
856
|
+
parts.push(text.slice(start, index));
|
|
857
|
+
start = index + 1;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
parts.push(text.slice(start));
|
|
861
|
+
return parts;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
function topLevelColon(text) {
|
|
865
|
+
let depth = 0;
|
|
866
|
+
let quote = null;
|
|
867
|
+
let escaped = false;
|
|
868
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
869
|
+
const char = text[index];
|
|
870
|
+
if (quote !== null) {
|
|
871
|
+
if (escaped) escaped = false;
|
|
872
|
+
else if (char === "\\") escaped = true;
|
|
873
|
+
else if (char === quote) quote = null;
|
|
874
|
+
continue;
|
|
875
|
+
}
|
|
876
|
+
if (char === '"' || char === "'" || char === "`") quote = char;
|
|
877
|
+
else if ("({[".includes(char)) depth += 1;
|
|
878
|
+
else if (")}]".includes(char)) depth -= 1;
|
|
879
|
+
else if (char === ":" && depth === 0) return index;
|
|
880
|
+
}
|
|
881
|
+
return -1;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/** Parse only data literals. Computed values remain unresolved, never evaluated. */
|
|
885
|
+
function literalValue(raw) {
|
|
886
|
+
const text = String(raw ?? "").trim();
|
|
887
|
+
if (text === "") return undefined;
|
|
888
|
+
if (text === "true") return true;
|
|
889
|
+
if (text === "false") return false;
|
|
890
|
+
if (text === "null") return null;
|
|
891
|
+
if (/^-?(?:\d+\.?\d*|\.\d+)$/.test(text)) return Number(text);
|
|
892
|
+
if (text.startsWith("{") && text.endsWith("}")) {
|
|
893
|
+
const output = {};
|
|
894
|
+
for (const part of splitLiteral(text.slice(1, -1))) {
|
|
895
|
+
const colon = topLevelColon(part);
|
|
896
|
+
if (colon === -1) return undefined;
|
|
897
|
+
const keyText = part.slice(0, colon).trim();
|
|
898
|
+
const key = /^(?:["']([^"']+)["']|([A-Za-z_$][\w$]*))$/.exec(keyText);
|
|
899
|
+
if (key === null) return undefined;
|
|
900
|
+
const value = literalValue(part.slice(colon + 1));
|
|
901
|
+
if (value === undefined) return undefined;
|
|
902
|
+
output[key[1] ?? key[2]] = value;
|
|
903
|
+
}
|
|
904
|
+
return output;
|
|
905
|
+
}
|
|
906
|
+
if (text.startsWith("[") && text.endsWith("]")) {
|
|
907
|
+
const values = [];
|
|
908
|
+
for (const part of splitLiteral(text.slice(1, -1))) {
|
|
909
|
+
if (part.trim() === "") continue;
|
|
910
|
+
const value = literalValue(part);
|
|
911
|
+
if (value === undefined) return undefined;
|
|
912
|
+
values.push(value);
|
|
913
|
+
}
|
|
914
|
+
return values;
|
|
915
|
+
}
|
|
916
|
+
if ((text.startsWith('"') && text.endsWith('"')) || (text.startsWith("'") && text.endsWith("'"))) {
|
|
917
|
+
const quote = text[0];
|
|
918
|
+
const body = text.slice(1, -1);
|
|
919
|
+
if (body.includes("${")) return undefined;
|
|
920
|
+
try {
|
|
921
|
+
return quote === '"' ? JSON.parse(text) : body.replace(/\\(['\\])/g, "$1");
|
|
922
|
+
} catch {
|
|
923
|
+
return undefined;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
return undefined;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
function requestOptionsFromObject(text) {
|
|
930
|
+
if (!text?.startsWith("{") || !text.endsWith("}")) return null;
|
|
931
|
+
const options = {};
|
|
932
|
+
for (const part of splitLiteral(text.slice(1, -1))) {
|
|
933
|
+
const colon = topLevelColon(part);
|
|
934
|
+
if (colon === -1) continue;
|
|
935
|
+
const key = part.slice(0, colon).trim().replace(/^["']|["']$/g, "");
|
|
936
|
+
if (!["url", "method", "data", "header"].includes(key)) continue;
|
|
937
|
+
const value = literalValue(part.slice(colon + 1));
|
|
938
|
+
if (value !== undefined) options[key] = key === "method" && typeof value === "string" ? value.toUpperCase() : value;
|
|
939
|
+
}
|
|
940
|
+
return options;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
function uniRequestCalls(text) {
|
|
944
|
+
const calls = [];
|
|
945
|
+
for (const match of text.matchAll(/\buni\s*\.\s*request\s*\(/g)) {
|
|
946
|
+
const open = text.indexOf("(", match.index);
|
|
947
|
+
const close = matchingDelimiter(text, open);
|
|
948
|
+
if (close !== -1) calls.push({ start: match.index, end: close });
|
|
949
|
+
}
|
|
950
|
+
return calls;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
function objectArgumentAt(text, call) {
|
|
954
|
+
const openParen = text.indexOf("(", call.start);
|
|
955
|
+
const args = callArguments(text.slice(call.start, call.end + 1));
|
|
956
|
+
const first = args[0];
|
|
957
|
+
if (first === undefined || !first.text.startsWith("{")) return null;
|
|
958
|
+
const start = call.start + first.offset;
|
|
959
|
+
const end = matchingDelimiter(text, start, "{", "}");
|
|
960
|
+
if (end === -1) return null;
|
|
961
|
+
return { start, end, text: text.slice(start, end + 1), openParen };
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
function enclosingGraphNode({ graph, uri, callStart, text }) {
|
|
965
|
+
const candidates = [...graph.nodes.values()].filter(node =>
|
|
966
|
+
node.file_path === uri && node.kind !== "file" && nonEmpty(node.name));
|
|
967
|
+
let best = null;
|
|
968
|
+
let bestIndex = -1;
|
|
969
|
+
for (const node of candidates) {
|
|
970
|
+
const escaped = node.name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
971
|
+
const declaration = new RegExp(`\\b(?:function\\s+${escaped}|${escaped}\\s*\\()`).exec(text.slice(0, callStart));
|
|
972
|
+
if (declaration !== null && declaration.index > bestIndex) {
|
|
973
|
+
best = node;
|
|
974
|
+
bestIndex = declaration.index;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
return best;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
function wrapperConstruction({ graph, sendNode, sourceCache, readSource }) {
|
|
981
|
+
if (sendNode === null) return null;
|
|
982
|
+
const incoming = graph.edges.filter(edge => edge.target_id === sendNode.id && edge.kind === "calls");
|
|
983
|
+
for (const edge of incoming.sort((a, b) => (a.line ?? 0) - (b.line ?? 0) || a.id - b.id)) {
|
|
984
|
+
if (!nonEmpty(edge.source_file) || isExcludedEvidencePath(edge.source_file)) continue;
|
|
985
|
+
const text = readSource(edge.source_file);
|
|
986
|
+
if (text === null) continue;
|
|
987
|
+
const escaped = sendNode.name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
988
|
+
const calls = [];
|
|
989
|
+
for (const match of text.matchAll(new RegExp(`\\b${escaped}\\s*\\(`, "g"))) {
|
|
990
|
+
const open = text.indexOf("(", match.index);
|
|
991
|
+
const close = matchingDelimiter(text, open);
|
|
992
|
+
if (close !== -1) calls.push({ start: match.index, end: close, line: lineAt(text, match.index) });
|
|
993
|
+
}
|
|
994
|
+
calls.sort((a, b) => Math.abs(a.line - (edge.line ?? a.line)) - Math.abs(b.line - (edge.line ?? b.line)));
|
|
995
|
+
for (const call of calls) {
|
|
996
|
+
const object = objectArgumentAt(text, call);
|
|
997
|
+
if (object === null) continue;
|
|
998
|
+
const options = requestOptionsFromObject(object.text);
|
|
999
|
+
if (options === null) continue;
|
|
1000
|
+
return {
|
|
1001
|
+
options,
|
|
1002
|
+
span: lineRef(edge.source_file, text, object.start, object.end + 1),
|
|
1003
|
+
uri: edge.source_file,
|
|
1004
|
+
call,
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
return null;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
function interceptorBody(text, configStart, configEnd, method) {
|
|
1012
|
+
const config = text.slice(configStart, configEnd + 1);
|
|
1013
|
+
const pattern = new RegExp(`\\b${method}\\s*\\([^)]*\\)\\s*\\{`, "g");
|
|
1014
|
+
const match = pattern.exec(config);
|
|
1015
|
+
if (match === null) return null;
|
|
1016
|
+
const open = configStart + match.index + match[0].lastIndexOf("{");
|
|
1017
|
+
const close = matchingDelimiter(text, open, "{", "}");
|
|
1018
|
+
if (close === -1 || close > configEnd) return null;
|
|
1019
|
+
return { start: open + 1, end: close - 1, text: text.slice(open + 1, close) };
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
function mutationLine(uri, text, absolute, extra = {}) {
|
|
1023
|
+
return { ...lineRef(uri, text, absolute), ...extra };
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
function requestMutations(uri, text, body) {
|
|
1027
|
+
const mutations = [];
|
|
1028
|
+
const add = (match, mutation) => mutations.push(mutationLine(uri, text, body.start + match.index, mutation));
|
|
1029
|
+
const patterns = [
|
|
1030
|
+
{ re: /\boptions\s*\.\s*url\s*=\s*([^\n;]+)/g, target: "url" },
|
|
1031
|
+
{ re: /\boptions\s*\.\s*header\s*\.\s*([A-Za-z_$][\w$]*)\s*=\s*([^\n;]+)/g, target: "header" },
|
|
1032
|
+
{ re: /\boptions\s*\.\s*data\s*\.\s*([A-Za-z_$][\w$]*)\s*=\s*([^\n;]+)/g, target: "data" },
|
|
1033
|
+
];
|
|
1034
|
+
for (const { re, target } of patterns) {
|
|
1035
|
+
for (const match of body.text.matchAll(re)) {
|
|
1036
|
+
const valueText = target === "url" ? match[1] : match[2];
|
|
1037
|
+
const wireName = target === "url" ? "url" : match[1];
|
|
1038
|
+
add(match, {
|
|
1039
|
+
kind: "set", target, wire_name: wireName,
|
|
1040
|
+
value: literalValue(valueText), value_text: valueText.trim(),
|
|
1041
|
+
});
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
for (const match of body.text.matchAll(/\bdelete\s+options\s*\.\s*data\s*\.\s*([A-Za-z_$][\w$]*)/g)) {
|
|
1045
|
+
add(match, { kind: "delete", target: "data", wire_name: match[1] });
|
|
1046
|
+
}
|
|
1047
|
+
return mutations.sort((a, b) => a.span.start - b.span.start || cmp(a.wire_name, b.wire_name));
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
function requestRole(mutations) {
|
|
1051
|
+
if (mutations.some(mutation => mutation.target === "url")) return "normalize-url";
|
|
1052
|
+
if (mutations.some(mutation => mutation.target === "header"
|
|
1053
|
+
&& /Authorization|session/i.test(mutation.wire_name))) return "inject-session";
|
|
1054
|
+
if (mutations.some(mutation => mutation.target === "data")) return "redact-fields";
|
|
1055
|
+
return "request-mutation";
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
function responseMutation(uri, text, body) {
|
|
1059
|
+
const match = /\bresponse\s*\.\s*data\s*\.\s*([A-Za-z_$][\w$]*)\s*=\s*([^\n;]+)/.exec(body.text);
|
|
1060
|
+
const wireName = match?.[1] ?? "data";
|
|
1061
|
+
const extra = {
|
|
1062
|
+
role: "response-interceptor",
|
|
1063
|
+
wire_name: wireName,
|
|
1064
|
+
...(match === null ? {} : { mutations: [{
|
|
1065
|
+
kind: "set", target: "response", wire_name: wireName,
|
|
1066
|
+
value: literalValue(match[2]), value_text: match[2].trim(),
|
|
1067
|
+
}] }),
|
|
1068
|
+
};
|
|
1069
|
+
return mutationLine(uri, text, body.start + (match?.index ?? 0), extra);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
function offsetAtLine(text, line) {
|
|
1073
|
+
if (!Number.isInteger(line) || line < 1) return Number.MAX_SAFE_INTEGER;
|
|
1074
|
+
let offset = 0;
|
|
1075
|
+
for (let current = 1; current < line; current += 1) {
|
|
1076
|
+
const newline = text.indexOf("\n", offset);
|
|
1077
|
+
if (newline === -1) return Number.MAX_SAFE_INTEGER;
|
|
1078
|
+
offset = newline + 1;
|
|
1079
|
+
}
|
|
1080
|
+
return offset;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Read interceptor registrations and place them in module evaluation order.
|
|
1085
|
+
* Static imports are visited in source order and evaluated before the importer;
|
|
1086
|
+
* registrations within one module retain their exact source offsets.
|
|
1087
|
+
*/
|
|
1088
|
+
function uniInterceptors(graph, entrypointFiles, readSource) {
|
|
1089
|
+
const registrationsByFile = new Map();
|
|
1090
|
+
for (const uri of [...graph.files].sort(cmp)) {
|
|
1091
|
+
const text = readSource(uri);
|
|
1092
|
+
if (text === null) continue;
|
|
1093
|
+
const registrations = [];
|
|
1094
|
+
const registration = /\b(?:uni\s*\.\s*)?addInterceptor\s*\(\s*(["'])request\1\s*,\s*\{/g;
|
|
1095
|
+
for (const match of text.matchAll(registration)) {
|
|
1096
|
+
const open = text.indexOf("{", match.index);
|
|
1097
|
+
const close = matchingDelimiter(text, open, "{", "}");
|
|
1098
|
+
if (close === -1) continue;
|
|
1099
|
+
const invoke = interceptorBody(text, open, close, "invoke");
|
|
1100
|
+
const success = interceptorBody(text, open, close, "success");
|
|
1101
|
+
const complete = interceptorBody(text, open, close, "complete");
|
|
1102
|
+
const mutations = invoke === null ? [] : requestMutations(uri, text, invoke);
|
|
1103
|
+
const responseSpans = [];
|
|
1104
|
+
if (success !== null) responseSpans.push(responseMutation(uri, text, success));
|
|
1105
|
+
if (complete !== null) {
|
|
1106
|
+
responseSpans.push(mutationLine(uri, text, complete.start, { role: "complete", wire_name: "complete" }));
|
|
1107
|
+
}
|
|
1108
|
+
registrations.push({
|
|
1109
|
+
uri, order: match.index, mutations,
|
|
1110
|
+
transform: invoke === null ? null : mutationLine(uri, text, invoke.start, {
|
|
1111
|
+
role: requestRole(mutations),
|
|
1112
|
+
wire_name: [...mutations].reverse().find(mutation => mutation.target !== "url")?.wire_name
|
|
1113
|
+
?? mutations[0]?.wire_name ?? null,
|
|
1114
|
+
mutations,
|
|
1115
|
+
}),
|
|
1116
|
+
responseSpans,
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
if (registrations.length > 0) registrationsByFile.set(uri, registrations);
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
const importsByFile = new Map();
|
|
1123
|
+
for (const edge of graph.edges) {
|
|
1124
|
+
if (edge.kind !== "imports" || !nonEmpty(edge.source_file) || !nonEmpty(edge.target_file)) continue;
|
|
1125
|
+
if (!importsByFile.has(edge.source_file)) importsByFile.set(edge.source_file, []);
|
|
1126
|
+
importsByFile.get(edge.source_file).push(edge);
|
|
1127
|
+
}
|
|
1128
|
+
for (const [uri, edges] of importsByFile) {
|
|
1129
|
+
const text = readSource(uri) ?? "";
|
|
1130
|
+
edges.sort((a, b) => offsetAtLine(text, a.line) - offsetAtLine(text, b.line)
|
|
1131
|
+
|| (a.line ?? 0) - (b.line ?? 0) || a.id - b.id);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
const state = new Map();
|
|
1135
|
+
const stack = [];
|
|
1136
|
+
const cycleFiles = new Set();
|
|
1137
|
+
const evaluated = [];
|
|
1138
|
+
const visit = uri => {
|
|
1139
|
+
const current = state.get(uri);
|
|
1140
|
+
if (current === "done") return;
|
|
1141
|
+
if (current === "visiting") {
|
|
1142
|
+
const start = stack.indexOf(uri);
|
|
1143
|
+
for (const file of stack.slice(Math.max(0, start))) cycleFiles.add(file);
|
|
1144
|
+
cycleFiles.add(uri);
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
state.set(uri, "visiting");
|
|
1148
|
+
stack.push(uri);
|
|
1149
|
+
for (const edge of importsByFile.get(uri) ?? []) visit(edge.target_file);
|
|
1150
|
+
stack.pop();
|
|
1151
|
+
state.set(uri, "done");
|
|
1152
|
+
evaluated.push(uri);
|
|
1153
|
+
};
|
|
1154
|
+
for (const uri of entrypointFiles) visit(uri);
|
|
1155
|
+
|
|
1156
|
+
const evaluatedSet = new Set(evaluated);
|
|
1157
|
+
const orderedFiles = evaluated.filter(uri => registrationsByFile.has(uri));
|
|
1158
|
+
const detached = [...registrationsByFile.keys()].filter(uri => !evaluatedSet.has(uri)).sort(cmp);
|
|
1159
|
+
const crossFile = registrationsByFile.size > 1;
|
|
1160
|
+
const partial = crossFile && (detached.length > 0
|
|
1161
|
+
|| [...cycleFiles].some(uri => registrationsByFile.has(uri)));
|
|
1162
|
+
// Detached registrations remain visible as partial evidence. Their lexical
|
|
1163
|
+
// placement is not claimed as runtime order; `partial` blocks a final-value
|
|
1164
|
+
// assertion whenever more than one file has no deterministic evaluation path.
|
|
1165
|
+
const files = crossFile ? [...orderedFiles, ...detached] : [...registrationsByFile.keys()];
|
|
1166
|
+
return {
|
|
1167
|
+
items: files.flatMap(uri => registrationsByFile.get(uri)
|
|
1168
|
+
.slice().sort((a, b) => a.order - b.order)),
|
|
1169
|
+
partial,
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
function directResponseEvidence(uri, text, call) {
|
|
1174
|
+
const spans = [];
|
|
1175
|
+
const callText = text.slice(call.start, call.end + 1);
|
|
1176
|
+
const success = /\bsuccess\s*(?:\([^)]*\)|:)/.exec(callText);
|
|
1177
|
+
const complete = /\bcomplete\s*(?:\([^)]*\)|:)/.exec(callText);
|
|
1178
|
+
if (success !== null) {
|
|
1179
|
+
spans.push(mutationLine(uri, text, call.start + success.index, { role: "callback", wire_name: "success" }));
|
|
1180
|
+
}
|
|
1181
|
+
if (complete !== null) {
|
|
1182
|
+
spans.push(mutationLine(uri, text, call.start + complete.index, { role: "complete", wire_name: "complete" }));
|
|
1183
|
+
}
|
|
1184
|
+
const tail = text.slice(call.end + 1, Math.min(text.length, call.end + 1500));
|
|
1185
|
+
const then = /^\s*\.\s*(?:then|catch|finally)\s*\(/.exec(tail);
|
|
1186
|
+
if (then !== null) {
|
|
1187
|
+
spans.push(mutationLine(uri, text, call.end + 1 + then.index, { role: "promise", wire_name: "Promise" }));
|
|
1188
|
+
}
|
|
1189
|
+
return {
|
|
1190
|
+
spans,
|
|
1191
|
+
behavior: {
|
|
1192
|
+
promise: then !== null,
|
|
1193
|
+
callback: success !== null || /\bfail\s*(?:\([^)]*\)|:)/.test(callText),
|
|
1194
|
+
complete: complete !== null,
|
|
1195
|
+
},
|
|
1196
|
+
};
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
function applyRequestMutations(options, interceptors) {
|
|
1200
|
+
const url = options.url ?? null;
|
|
1201
|
+
const data = options.data === undefined ? null : structuredClone(options.data);
|
|
1202
|
+
const header = options.header === undefined ? {} : structuredClone(options.header);
|
|
1203
|
+
let partial = false;
|
|
1204
|
+
const state = { url, data, header };
|
|
1205
|
+
for (const interceptor of interceptors) {
|
|
1206
|
+
for (const mutation of interceptor.mutations) {
|
|
1207
|
+
if (mutation.kind === "delete") {
|
|
1208
|
+
if (state.data !== null && typeof state.data === "object") delete state.data[mutation.wire_name];
|
|
1209
|
+
continue;
|
|
1210
|
+
}
|
|
1211
|
+
if (mutation.value === undefined) {
|
|
1212
|
+
partial = true;
|
|
1213
|
+
continue;
|
|
1214
|
+
}
|
|
1215
|
+
if (mutation.target === "url") state.url = mutation.value;
|
|
1216
|
+
if (mutation.target === "header") state.header[mutation.wire_name] = mutation.value;
|
|
1217
|
+
if (mutation.target === "data") {
|
|
1218
|
+
if (state.data === null || typeof state.data !== "object") state.data = {};
|
|
1219
|
+
state.data[mutation.wire_name] = mutation.value;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
return { ...state, partial };
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
function operationUnknown(reason, nextAction) {
|
|
1227
|
+
return { scope: "operation", reason, next_action: nextAction };
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
function unsupportedUniCandidate(page, extension) {
|
|
1231
|
+
const candidate = partialCandidate(page);
|
|
1232
|
+
candidate.unknown = operationUnknown(
|
|
1233
|
+
"unsupported-source-extension",
|
|
1234
|
+
`Add explicit .${extension} SOURCE parsing support before discovering this page's operations`,
|
|
1235
|
+
);
|
|
1236
|
+
return candidate;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
function dynamicUniCandidate(page, reason = "dynamic-wrapper-unresolved") {
|
|
1240
|
+
const candidate = partialCandidate(page);
|
|
1241
|
+
candidate.unknown = operationUnknown(
|
|
1242
|
+
reason,
|
|
1243
|
+
"Resolve the dynamic wrapper or request URL to a concrete source-backed transport and rerun operation discovery",
|
|
1244
|
+
);
|
|
1245
|
+
return candidate;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* Discover UniApp operations only from real index paths and current SOURCE bytes.
|
|
1250
|
+
* Direct transport mutations, wrappers, and interceptors remain distinct evidence.
|
|
1251
|
+
*/
|
|
1252
|
+
export function discoverUniAppOperations({
|
|
1253
|
+
page,
|
|
1254
|
+
entryEvidence = new Map(),
|
|
1255
|
+
db = null,
|
|
1256
|
+
sourceProject,
|
|
1257
|
+
endpoints = [],
|
|
1258
|
+
footprint = new Map(),
|
|
1259
|
+
} = {}) {
|
|
1260
|
+
if (!page || !nonEmpty(page.page_id)) throw new TypeError("discoverUniAppOperations: page.page_id is required");
|
|
1261
|
+
if (!nonEmpty(sourceProject)) throw new TypeError("discoverUniAppOperations: sourceProject must be a non-empty string");
|
|
1262
|
+
const operationPage = operationPageOf(page, footprint);
|
|
1263
|
+
const sourcePage = operationPage.page;
|
|
1264
|
+
const declared = firstLocator(sourcePage.declared_at, sourcePage.source_file);
|
|
1265
|
+
const extension = declared === null ? "" : path.extname(declared).toLowerCase();
|
|
1266
|
+
if (extension === ".nvue" || extension === ".uvue") return [unsupportedUniCandidate(page, extension.slice(1))];
|
|
1267
|
+
const entryRecord = entryEvidence instanceof Map
|
|
1268
|
+
? entryEvidence.get(page.page_id) ?? {}
|
|
1269
|
+
: entryEvidence?.[page.page_id] ?? entryEvidence ?? {};
|
|
1270
|
+
const seedFiles = pageLocators(sourcePage, entryRecord, operationPage.resolveLocator ?? null);
|
|
1271
|
+
const graph = traverseUniGraph(db, seedFiles);
|
|
1272
|
+
if (graph.files.size === 0) {
|
|
1273
|
+
return seedFiles.size === 0 ? [] : [dynamicUniCandidate(page, "operation-discovery-partial")];
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
const sourceCache = new Map();
|
|
1277
|
+
const readSource = uri => {
|
|
1278
|
+
if (!nonEmpty(uri) || isExcludedEvidencePath(uri)) return null;
|
|
1279
|
+
if (sourceCache.has(uri)) return sourceCache.get(uri);
|
|
1280
|
+
const canonical = canonicalSourcePath(uri, sourceProject);
|
|
1281
|
+
let text = null;
|
|
1282
|
+
if (canonical !== null) {
|
|
1283
|
+
try { text = fs.readFileSync(path.resolve(sourceProject, canonical), "utf8"); } catch { text = null; }
|
|
1284
|
+
}
|
|
1285
|
+
sourceCache.set(uri, text);
|
|
1286
|
+
return text;
|
|
1287
|
+
};
|
|
1288
|
+
const interceptorEvidence = uniInterceptors(graph, operationPage.entrypointFiles, readSource);
|
|
1289
|
+
const interceptors = interceptorEvidence.items;
|
|
1290
|
+
const operations = [];
|
|
1291
|
+
for (const uri of [...graph.files].sort(cmp)) {
|
|
1292
|
+
const text = readSource(uri);
|
|
1293
|
+
if (text === null) continue;
|
|
1294
|
+
for (const call of uniRequestCalls(text)) {
|
|
1295
|
+
const base = candidateFromCall({ page, uri, text, callStart: call.start, callEnd: call.end });
|
|
1296
|
+
const sendNode = enclosingGraphNode({ graph, uri, callStart: call.start, text });
|
|
1297
|
+
const directObject = objectArgumentAt(text, call);
|
|
1298
|
+
const directOptions = directObject === null ? {} : requestOptionsFromObject(directObject.text) ?? {};
|
|
1299
|
+
const wrapper = wrapperConstruction({ graph, sendNode, sourceCache, readSource });
|
|
1300
|
+
const initialOptions = wrapper?.options ?? directOptions;
|
|
1301
|
+
const mutated = applyRequestMutations(initialOptions, interceptors);
|
|
1302
|
+
const directResponse = directResponseEvidence(uri, text, call);
|
|
1303
|
+
const responseSpans = [
|
|
1304
|
+
...interceptors.flatMap(interceptor => interceptor.responseSpans),
|
|
1305
|
+
...directResponse.spans,
|
|
1306
|
+
];
|
|
1307
|
+
const dedupedResponses = [...new Map(responseSpans.map(span =>
|
|
1308
|
+
[`${span.uri}:${span.span.start}:${span.role}`, span])).values()];
|
|
1309
|
+
const transformSpans = interceptors.filter(interceptor => interceptor.transform !== null)
|
|
1310
|
+
.map(interceptor => interceptor.transform);
|
|
1311
|
+
const asyncBehavior = {
|
|
1312
|
+
promise: directResponse.behavior.promise,
|
|
1313
|
+
callback: directResponse.behavior.callback,
|
|
1314
|
+
complete: directResponse.behavior.complete || interceptors.some(interceptor =>
|
|
1315
|
+
interceptor.responseSpans.some(span => span.role === "complete")),
|
|
1316
|
+
};
|
|
1317
|
+
const constructorSpan = wrapper?.span ?? (directObject === null ? base.constructor_span
|
|
1318
|
+
: lineRef(uri, text, directObject.start, directObject.end + 1));
|
|
1319
|
+
const sendSpan = lineRef(uri, text, call.start, call.end + 1);
|
|
1320
|
+
const callPath = sendNode === null ? [] : (graph.paths.get(sendNode.id) ?? []);
|
|
1321
|
+
const status = graph.partial || interceptorEvidence.partial || mutated.partial
|
|
1322
|
+
|| typeof mutated.url !== "string" || mutated.url === ""
|
|
1323
|
+
? "partial" : "discovered";
|
|
1324
|
+
const operation = {
|
|
1325
|
+
...base,
|
|
1326
|
+
operation_id: `op_${stableDigest({ page_id: page.page_id, constructor_span: constructorSpan, send_span: sendSpan })}`,
|
|
1327
|
+
constructor_span: constructorSpan,
|
|
1328
|
+
transform_spans: transformSpans,
|
|
1329
|
+
encode_span: constructorSpan,
|
|
1330
|
+
send_span: sendSpan,
|
|
1331
|
+
response_spans: dedupedResponses,
|
|
1332
|
+
call_path: callPath,
|
|
1333
|
+
url: mutated.url,
|
|
1334
|
+
method: initialOptions.method ?? null,
|
|
1335
|
+
data: mutated.data,
|
|
1336
|
+
header: mutated.header,
|
|
1337
|
+
async_behavior: asyncBehavior,
|
|
1338
|
+
status,
|
|
1339
|
+
unknown: status === "partial" ? (interceptorEvidence.partial ? operationUnknown(
|
|
1340
|
+
"interceptor-order-unresolved",
|
|
1341
|
+
"Connect every request interceptor module to a deterministic entrypoint import/evaluation path and rerun operation discovery",
|
|
1342
|
+
) : operationUnknown(
|
|
1343
|
+
"dynamic-wrapper-unresolved",
|
|
1344
|
+
"Resolve every dynamic request value and bounded HomeGraph path before completing this operation",
|
|
1345
|
+
)) : null,
|
|
1346
|
+
};
|
|
1347
|
+
operations.push(operation);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
if (operations.length === 0) {
|
|
1351
|
+
const dynamic = [...graph.files].some(uri => {
|
|
1352
|
+
const text = readSource(uri);
|
|
1353
|
+
return text !== null && /\btransport\s*\(|\buni\s*\[/.test(text);
|
|
1354
|
+
});
|
|
1355
|
+
return [dynamicUniCandidate(page, dynamic ? "dynamic-wrapper-unresolved" : "operation-discovery-partial")];
|
|
1356
|
+
}
|
|
1357
|
+
return operations.sort((a, b) => cmp(a.operation_id, b.operation_id));
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* Discover request operations from actual source call sites. Endpoint facts
|
|
1362
|
+
* provide names and transport hints only; their declarations are never used as
|
|
1363
|
+
* constructor or send evidence.
|
|
1364
|
+
*/
|
|
1365
|
+
/** `feature/<name>/` for a path under a feature module, otherwise null. */
|
|
1366
|
+
function featureModulePrefix(locator) {
|
|
1367
|
+
const file = String(locator ?? "").replace(/\\/g, "/");
|
|
1368
|
+
const parts = file.split("/");
|
|
1369
|
+
if (parts.length < 3 || parts[0] !== "feature") return null;
|
|
1370
|
+
return `${parts[0]}/${parts[1]}/`;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
/** The feature modules a page's own declaration/origin files belong to. */
|
|
1374
|
+
export function pageModulePrefixes(values = []) {
|
|
1375
|
+
const prefixes = new Set();
|
|
1376
|
+
for (const value of values) {
|
|
1377
|
+
const prefix = featureModulePrefix(value);
|
|
1378
|
+
if (prefix !== null) prefixes.add(prefix);
|
|
1379
|
+
}
|
|
1380
|
+
return [...prefixes].sort(cmp);
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* Whether an operation is initiated by this page or is only reachable through
|
|
1385
|
+
* it. Page-owned operations live in the page's own feature module, or in a
|
|
1386
|
+
* shared `core/` file called directly from that module. Everything else
|
|
1387
|
+
* (another feature module, or a shared file only reached through one) is an
|
|
1388
|
+
* external dependency: its evidence stays in the ledger, but the page is not
|
|
1389
|
+
* required to review or project it into its own SPEC.
|
|
1390
|
+
*
|
|
1391
|
+
* Ecosystems without feature-module paths (uni-app `src/pages/...`, small
|
|
1392
|
+
* fixtures) keep the previous "every candidate belongs to the page" contract.
|
|
1393
|
+
*/
|
|
1394
|
+
export function operationOwner({ uri, modulePrefixes = [], callerFiles = [] }) {
|
|
1395
|
+
if (modulePrefixes.length === 0) return "page";
|
|
1396
|
+
const file = String(uri ?? "").replace(/\\/g, "/");
|
|
1397
|
+
if (modulePrefixes.some(prefix => file.startsWith(prefix))) return "page";
|
|
1398
|
+
if (file.startsWith("core/")
|
|
1399
|
+
&& callerFiles.some(caller => modulePrefixes.some(prefix =>
|
|
1400
|
+
String(caller ?? "").replace(/\\/g, "/").startsWith(prefix)))) {
|
|
1401
|
+
return "page";
|
|
1402
|
+
}
|
|
1403
|
+
return "external";
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
export function discoverOperations({
|
|
1407
|
+
pages,
|
|
1408
|
+
entryEvidence = new Map(),
|
|
1409
|
+
db = null,
|
|
1410
|
+
sourceProject,
|
|
1411
|
+
endpoints = [],
|
|
1412
|
+
query = null,
|
|
1413
|
+
footprint = new Map(),
|
|
1414
|
+
maskImpl = maskNonCode,
|
|
1415
|
+
} = {}) {
|
|
1416
|
+
if (!Array.isArray(pages)) throw new TypeError("discoverOperations: pages must be an array");
|
|
1417
|
+
if (!nonEmpty(sourceProject)) throw new TypeError("discoverOperations: sourceProject must be a non-empty string");
|
|
1418
|
+
const entries = entryEvidence instanceof Map ? entryEvidence : new Map(Object.entries(entryEvidence ?? {}));
|
|
1419
|
+
const result = new Map();
|
|
1420
|
+
let operationCallers = null;
|
|
1421
|
+
if (db && typeof db.prepare === "function") {
|
|
1422
|
+
try {
|
|
1423
|
+
const statement = db.prepare(`
|
|
1424
|
+
SELECT DISTINCT n.file_path AS file_path
|
|
1425
|
+
FROM edges e JOIN nodes n ON n.id = e.source
|
|
1426
|
+
WHERE e.target = ? AND e.kind IN ('calls', 'instantiates', 'references')
|
|
1427
|
+
`);
|
|
1428
|
+
operationCallers = statement && typeof statement.all === "function" ? statement : null;
|
|
1429
|
+
} catch {
|
|
1430
|
+
// Ownership falls back to the feature-module check alone.
|
|
1431
|
+
operationCallers = null;
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
const sourceCache = new Map();
|
|
1435
|
+
const readSource = locator => {
|
|
1436
|
+
if (isExcludedEvidencePath(locator)) return null;
|
|
1437
|
+
if (sourceCache.has(locator)) return sourceCache.get(locator).text;
|
|
1438
|
+
const canonical = canonicalSourcePath(locator, sourceProject);
|
|
1439
|
+
let text = null;
|
|
1440
|
+
if (canonical !== null) {
|
|
1441
|
+
try {
|
|
1442
|
+
text = fs.readFileSync(path.resolve(sourceProject, canonical), "utf8");
|
|
1443
|
+
} catch {
|
|
1444
|
+
text = null;
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
sourceCache.set(locator, { text, maskedText: null });
|
|
1448
|
+
return text;
|
|
1449
|
+
};
|
|
1450
|
+
const readMaskedSource = locator => {
|
|
1451
|
+
const text = readSource(locator);
|
|
1452
|
+
if (text === null) return null;
|
|
1453
|
+
const snapshot = sourceCache.get(locator);
|
|
1454
|
+
if (snapshot.maskedText === null) snapshot.maskedText = maskImpl(text, locator);
|
|
1455
|
+
return snapshot.maskedText;
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1458
|
+
for (const page of [...pages].sort((a, b) => cmp(a.page_id, b.page_id))) {
|
|
1459
|
+
const entryRecord = entries.get(page.page_id) ?? {};
|
|
1460
|
+
const operationPage = operationPageOf(page, footprint);
|
|
1461
|
+
const declared = firstLocator(operationPage.page.declared_at, operationPage.page.source_file);
|
|
1462
|
+
if (declared !== null && /\.(?:vue|nvue|uvue)$/i.test(declared)) {
|
|
1463
|
+
result.set(page.page_id, discoverUniAppOperations({
|
|
1464
|
+
page, entryEvidence: entryRecord, db, sourceProject, footprint,
|
|
1465
|
+
endpoints: asArray(endpoints).filter(endpoint => !isExcludedEvidencePath(firstLocator(endpoint?.file))),
|
|
1466
|
+
}));
|
|
1467
|
+
continue;
|
|
1468
|
+
}
|
|
1469
|
+
if (asArray(endpoints).length === 0) {
|
|
1470
|
+
result.set(page.page_id, []);
|
|
1471
|
+
continue;
|
|
1472
|
+
}
|
|
1473
|
+
const queried = queryCalls({ page, endpoints, query });
|
|
1474
|
+
const called = dbCalls({ page, db });
|
|
1475
|
+
const functionGraph = operationFunctionGraph({ page, db });
|
|
1476
|
+
const graphPartial = () => queried.partial || called.partial || functionGraph.partial;
|
|
1477
|
+
const graphItems = [...queried.items, ...called.items];
|
|
1478
|
+
const ownershipPrefixes = pageModulePrefixes([
|
|
1479
|
+
page.declared_at, page.source_file,
|
|
1480
|
+
operationPage.page.declared_at, operationPage.page.source_file,
|
|
1481
|
+
...asArray(page.source_origins).flatMap(origin => [origin?.declared_at, origin?.source_file]),
|
|
1482
|
+
]);
|
|
1483
|
+
const locators = pageLocators(page, entryRecord);
|
|
1484
|
+
for (const locator of graphLocators(graphItems)) locators.add(locator);
|
|
1485
|
+
const footprintEntry = footprintEntryOf(footprint, page.page_id);
|
|
1486
|
+
const footprintFiles = footprintEntry?.all instanceof Set
|
|
1487
|
+
? [...footprintEntry.all]
|
|
1488
|
+
: asArray(footprintEntry?.all);
|
|
1489
|
+
const footprintOnly = new Set();
|
|
1490
|
+
for (const value of footprintFiles) {
|
|
1491
|
+
const locator = firstLocator(value);
|
|
1492
|
+
if (locator === null || isExcludedEvidencePath(locator)) continue;
|
|
1493
|
+
if (!locators.has(locator)) footprintOnly.add(locator);
|
|
1494
|
+
locators.add(locator);
|
|
1495
|
+
}
|
|
1496
|
+
// Direct transport facts belong to the file that performs the operation.
|
|
1497
|
+
// They can add a producer file, but never turn its declaration into a call.
|
|
1498
|
+
for (const endpoint of asArray(endpoints)) {
|
|
1499
|
+
if (isExcludedEvidencePath(firstLocator(endpoint?.file))) continue;
|
|
1500
|
+
if (locators.has(firstLocator(endpoint?.file))) locators.add(firstLocator(endpoint.file));
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
const candidates = new Map();
|
|
1504
|
+
for (const uri of [...locators].filter(nonEmpty).sort(cmp)) {
|
|
1505
|
+
const text = readSource(uri);
|
|
1506
|
+
if (text === null) continue;
|
|
1507
|
+
for (const endpoint of asArray(endpoints)) {
|
|
1508
|
+
if (isExcludedEvidencePath(firstLocator(endpoint?.file))) continue;
|
|
1509
|
+
const endpointFile = firstLocator(endpoint?.file);
|
|
1510
|
+
// A function-named endpoint may be called from a page/producer file;
|
|
1511
|
+
// directCalls validates the actual call in current source. Graph callees
|
|
1512
|
+
// add locators but never suppress a call they do not happen to name.
|
|
1513
|
+
// Its own declaration file is never invocation evidence.
|
|
1514
|
+
if (nonEmpty(endpoint?.function) && endpointFile === uri) continue;
|
|
1515
|
+
// Direct transports without a function must be observed in their own.
|
|
1516
|
+
if (!nonEmpty(endpoint?.function) && endpointFile !== uri) continue;
|
|
1517
|
+
for (const call of directCalls({ text, endpoint, maskedText: readMaskedSource(uri) })) {
|
|
1518
|
+
const enclosing = functionGraph.enclosingNode(uri, call.start, text);
|
|
1519
|
+
if (footprintOnly.has(uri)
|
|
1520
|
+
&& (enclosing === null || !functionGraph.reachable.has(enclosing.id))) continue;
|
|
1521
|
+
const candidate = candidateFromCall({
|
|
1522
|
+
page, uri, text, callStart: call.start, callEnd: call.end, partial: graphPartial(),
|
|
1523
|
+
db, readSource, readMaskedSource, maskedText: readMaskedSource(uri), callerNode: enclosing,
|
|
1524
|
+
});
|
|
1525
|
+
const callerFiles = enclosing !== null && operationCallers !== null
|
|
1526
|
+
? operationCallers.all(enclosing.id).map(row => row.file_path)
|
|
1527
|
+
: [];
|
|
1528
|
+
candidate.owner = operationOwner({
|
|
1529
|
+
uri, modulePrefixes: ownershipPrefixes, callerFiles,
|
|
1530
|
+
});
|
|
1531
|
+
if (!candidates.has(candidate.operation_id)) candidates.set(candidate.operation_id, candidate);
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
if (candidates.size === 0 && graphPartial()) {
|
|
1536
|
+
const candidate = partialCandidate(page);
|
|
1537
|
+
candidates.set(candidate.operation_id, candidate);
|
|
1538
|
+
}
|
|
1539
|
+
result.set(page.page_id, [...candidates.values()].sort((a, b) => cmp(a.operation_id, b.operation_id)));
|
|
1540
|
+
}
|
|
1541
|
+
return result;
|
|
1542
|
+
}
|