@buaa_smat/hometrans 0.1.19 → 26.0.0-devecocli.2
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/build-fixer.md +406 -0
- package/agents/code-reviewer.md +461 -496
- package/agents/model-render-worker.md +34 -0
- package/agents/model-worker.md +23 -0
- package/agents/specgen-worker.md +18 -0
- package/commands/hometrans.md +17 -0
- package/devecocli-plugin/common.ts +2203 -0
- package/devecocli-plugin/install.ts +61 -0
- package/devecocli-plugin/uninstall.ts +26 -0
- package/devecocli-plugin/update.ts +66 -0
- package/index.js +1418 -0
- package/package.json +81 -66
- package/platforms/atomcode/agents/build-fixer.frontmatter.md +6 -0
- package/platforms/atomcode/agents/code-reviewer.frontmatter.md +6 -0
- package/platforms/atomcode/agents/model-render-worker.frontmatter.md +6 -0
- package/platforms/atomcode/agents/model-worker.frontmatter.md +6 -0
- package/platforms/atomcode/agents/specgen-worker.frontmatter.md +6 -0
- package/platforms/deveco/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/deveco/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/deveco/agents/model-worker.frontmatter.md +5 -0
- package/platforms/deveco/agents/specgen-worker.frontmatter.md +5 -0
- package/platforms/opencode/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/opencode/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/opencode/agents/model-worker.frontmatter.md +5 -0
- package/platforms/opencode/agents/specgen-worker.frontmatter.md +5 -0
- package/plugin.jsonc +12 -0
- package/skills/a2h-app-migrate/SKILL.md +181 -0
- package/skills/a2h-app-migrate/references/config.example.json +27 -0
- package/skills/a2h-app-migrate/references/specs.example.json +19 -0
- package/skills/a2h-app-migrate/references/stage-map.md +33 -0
- package/skills/a2h-app-migrate/references/workflow.yaml +1600 -0
- package/skills/a2h-app-migrate/scripts/android_index.mjs +109 -0
- package/skills/a2h-app-migrate/scripts/check_arch_done.mjs +80 -0
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +95 -0
- package/skills/a2h-app-migrate/scripts/check_signing.mjs +152 -0
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +114 -0
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +277 -0
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +77 -0
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +147 -0
- package/skills/a2h-app-migrate/scripts/cli_values.mjs +32 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1388 -0
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +651 -0
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +53 -0
- package/skills/a2h-app-migrate/scripts/json_io.mjs +35 -0
- package/skills/a2h-app-migrate/scripts/ledger.mjs +104 -0
- package/skills/a2h-app-migrate/scripts/lib-yaml-lite.mjs +288 -0
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +713 -0
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +205 -0
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +121 -0
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +212 -0
- package/skills/a2h-app-migrate/scripts/spec_layout.mjs +30 -0
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +455 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +80 -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 +92 -0
- package/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/skills/a2h-app-migrate/test/test_entry_guards.mjs +93 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +505 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +89 -0
- package/skills/a2h-app-migrate/test/test_gate_checkpoint.mjs +146 -0
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +68 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +91 -0
- package/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
- package/skills/a2h-app-migrate/test/test_json_io.mjs +32 -0
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +109 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +53 -0
- package/skills/a2h-app-migrate/test/test_parse_args.mjs +69 -0
- package/skills/a2h-app-migrate/test/test_preflight_report.mjs +83 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +144 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +315 -0
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +133 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +133 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +158 -0
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +181 -0
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +53 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
- package/skills/a2h-app-migrate/test/test_utg_dirs.mjs +39 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +168 -0
- package/skills/a2h-app-migrate/test/test_validate_races.mjs +50 -0
- package/skills/a2h-arch-generate/SKILL.md +375 -0
- package/skills/a2h-arch-generate/examples/reconcile-existing-project.md +107 -0
- package/skills/a2h-arch-generate/examples/simple-conversion-android.md +103 -0
- package/skills/a2h-arch-generate/examples/simple-conversion-backend.md +70 -0
- package/skills/a2h-arch-generate/examples/simple-conversion-uniapp.md +106 -0
- package/skills/a2h-arch-generate/references/artifact-contracts.generate.md +120 -0
- package/skills/a2h-arch-generate/references/artifact-contracts.reconcile.md +123 -0
- package/skills/a2h-arch-generate/references/bpta-layered-architecture-design.md +88 -0
- package/skills/a2h-arch-generate/references/clustering-guidance.md +33 -0
- package/skills/a2h-arch-generate/references/database-schema-recovery.md +107 -0
- package/skills/a2h-arch-generate/references/existing-target-annotation.md +68 -0
- package/skills/a2h-arch-generate/references/harmony-project-inspection.md +150 -0
- package/skills/a2h-arch-generate/references/harmony-target-architecture.md +94 -0
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +120 -0
- package/skills/a2h-arch-generate/references/module-evidence-subagent.md +45 -0
- package/skills/a2h-arch-generate/references/reconciliation-model.md +204 -0
- package/skills/a2h-arch-generate/references/scope-policy.md +28 -0
- package/skills/a2h-arch-generate/references/semantic-review.md +65 -0
- package/skills/a2h-arch-generate/references/source-baseline.md +93 -0
- package/skills/a2h-arch-generate/references/source-ecosystems.md +54 -0
- package/skills/a2h-arch-generate/references/transformation-model.md +78 -0
- package/skills/a2h-arch-generate/scripts/check_module_staleness.mjs +284 -0
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +260 -0
- package/skills/a2h-arch-generate/scripts/compute_processing_order.mjs +325 -0
- package/skills/a2h-arch-generate/scripts/create_project.mjs +149 -0
- package/skills/a2h-arch-generate/scripts/dump_core_facts.mjs +151 -0
- package/skills/a2h-arch-generate/scripts/extract_core_components.mjs +167 -0
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +363 -0
- package/skills/a2h-arch-generate/scripts/generate_state.mjs +60 -0
- package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +326 -0
- package/skills/a2h-arch-generate/scripts/inspect_android_project.mjs +3739 -0
- package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +800 -0
- package/skills/a2h-arch-generate/scripts/inspect_project.mjs +251 -0
- package/skills/a2h-arch-generate/scripts/inspect_uniapp_project.mjs +809 -0
- package/skills/a2h-arch-generate/scripts/lib/py_compat.mjs +1454 -0
- package/skills/a2h-arch-generate/scripts/module_create/create.mjs +136 -0
- package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +636 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/build-profile.json5 +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/hvigorfile.ts +6 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/obfuscation-rules.txt +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/oh-package.json5 +10 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/ets/applicationability/ApplicationAbility.ets +43 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/ets/pages/Index.ets +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/module.json5 +26 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/element/color.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/element/float.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/element/string.json +16 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/background.png +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/foreground.png +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/layered_image.json +7 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/startIcon.png +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/profile/main_pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/mock/mock-config.json5 +2 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/ohosTest/ets/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/ohosTest/module.json5 +11 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/test/LocalUnit.test.ets +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/Index.ets +1 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/build-profile.json5 +36 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/hvigorfile.ts +6 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/obfuscation-rules.txt +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/oh-package.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/ets/components/MainPage.ets +19 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/module.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/resources/base/element/float.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/resources/base/element/string.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/ohosTest/ets/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/ohosTest/module.json5 +11 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/test/LocalUnit.test.ets +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/Index.ets +1 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/build-profile.json5 +36 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/consumer-rules.txt +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/hvigorfile.ts +6 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/obfuscation-rules.txt +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/oh-package.json5 +10 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/ets/pages/Index.ets +20 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/ets/utils/Calc.ets +3 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/module.json5 +12 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/resources/base/element/float.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/resources/base/element/string.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/resources/base/profile/main_pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/ohosTest/ets/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/ohosTest/module.json5 +11 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/test/LocalUnit.test.ets +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/reconcile-layer-PROJECT_DESIGN.md +47 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/single-entry-PROJECT_DESIGN.md +15 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/three-layer-PROJECT_DESIGN.md +36 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/verification-report.md +150 -0
- package/skills/a2h-arch-generate/scripts/resolve_android_stores.mjs +529 -0
- package/skills/a2h-arch-generate/scripts/scaffold_project.mjs +230 -0
- 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 +1122 -0
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +191 -0
- package/skills/a2h-arch-generate/scripts/tests/test_console_encoding.mjs +52 -0
- package/skills/a2h-arch-generate/scripts/tests/test_git_root.mjs +34 -0
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +138 -0
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +829 -0
- package/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +937 -0
- package/skills/a2h-arch-generate/scripts/validate_homegraph_artifacts.mjs +542 -0
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +415 -0
- package/skills/a2h-arkts-logic-coder/SKILL.md +125 -0
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +6 -0
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +124 -0
- package/skills/a2h-arkts-logic-coder/scripts/check_module_scope.ts +224 -0
- package/skills/a2h-arkts-logic-coder/scripts/check_mvvm.ts +377 -0
- package/skills/a2h-arkts-logic-coder/scripts/stop_check_hook.ts +443 -0
- package/skills/a2h-arkts-logic-coder/scripts/test_check_scripts.ts +211 -0
- package/skills/a2h-arkts-logic-coder/scripts/test_worktree_compat.ts +81 -0
- package/skills/a2h-batch-ui-align/SKILL.md +309 -0
- package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +81 -0
- package/skills/a2h-batch-ui-align/flowchart.html +271 -0
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/conversion-procedure.md +523 -661
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +139 -0
- package/skills/a2h-batch-ui-align/references/lottie-integration.md +43 -0
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +8 -8
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +3 -0
- package/skills/a2h-batch-ui-align/references/source-only-tier.md +32 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +211 -0
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +192 -0
- package/skills/a2h-batch-ui-align/references/step5-convert.md +202 -0
- package/skills/a2h-batch-ui-align/scripts/agent_cli.mjs +572 -0
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/scripts/android_parse_fast.ts +246 -39
- package/skills/a2h-batch-ui-align/scripts/answers_check.mjs +86 -0
- package/skills/a2h-batch-ui-align/scripts/arkts_static_check.ts +2689 -0
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +1656 -0
- package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +79 -0
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +258 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1524 -0
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +612 -0
- package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +166 -0
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +1437 -0
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +1869 -0
- package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +696 -0
- package/skills/a2h-batch-ui-align/scripts/harmony_index.mjs +218 -0
- package/skills/a2h-batch-ui-align/scripts/host_env.mjs +208 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +1229 -0
- package/skills/a2h-batch-ui-align/scripts/occlusion.mjs +141 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1124 -0
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +996 -0
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +217 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_align_tint.test.mjs +253 -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_shell.test.mjs +72 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +353 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +345 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +290 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +74 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +507 -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 +189 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +1451 -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/measure_pack.test.mjs +170 -0
- package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +244 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +130 -0
- package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +49 -0
- package/skills/a2h-coldstart-smoke-gate/SKILL.md +57 -0
- package/skills/a2h-dashboard-render/SKILL.md +65 -0
- package/skills/a2h-dashboard-render/references/artifact-contract.jsonc +147 -0
- package/skills/a2h-dashboard-render/references/artifact-registry-spec.md +67 -0
- package/skills/a2h-dashboard-render/references/dashboard.config.example.json +19 -0
- package/skills/a2h-dashboard-render/references//347/234/213/346/235/277/350/257/264/346/230/216.md +83 -0
- package/skills/a2h-dashboard-render/scripts/artifact_contract.mjs +138 -0
- package/skills/a2h-dashboard-render/scripts/check-registry.mjs +87 -0
- package/skills/a2h-dashboard-render/scripts/dashboard.mjs +3215 -0
- package/skills/a2h-dashboard-render/scripts/device_capture.mjs +2010 -0
- package/skills/a2h-dashboard-render/scripts/page_capture.mjs +828 -0
- package/skills/a2h-dashboard-render/scripts/usage_readers.mjs +459 -0
- package/skills/a2h-dashboard-render/scripts/usage_worker.mjs +13 -0
- 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 +170 -0
- package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +99 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +182 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +64 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1172 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +251 -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 +303 -0
- package/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +444 -0
- package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/SKILL.md +305 -293
- package/skills/a2h-module-semantic-docs/SKILL.md +227 -0
- package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +168 -0
- package/skills/a2h-module-semantic-docs/scripts/lib/py_compat.mjs +688 -0
- package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +1021 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
- package/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
- package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/skills/a2h-resource-convert/SKILL.md +369 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/code-vector-icon-rules.md +4 -4
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/conversion-rules.md +16 -5
- package/skills/a2h-resource-convert/references/incremental-page-migration.md +251 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/lottie-conversion-rules.md +17 -17
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/resource-mapping-rules.md +15 -4
- package/skills/a2h-resource-convert/references/step3_5-dependency-filter.md +54 -0
- package/skills/a2h-resource-convert/references/step4-qualifiers-and-values.md +142 -0
- package/skills/a2h-resource-convert/references/step4-resource-types.md +249 -0
- package/skills/a2h-resource-convert/references/step5-reference-resolution.md +154 -0
- package/skills/a2h-resource-convert/references/step7-report-template.md +217 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/xml-drawable-to-svg-rules.md +38 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/scripts/a2h_resource_convert.ts +456 -90
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +1072 -0
- package/skills/a2h-resource-convert/scripts/app_identity.ts +947 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/scripts/code_vector_icons.ts +19 -3
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +989 -0
- package/skills/a2h-resource-convert/scripts/extract_project_resources.ts +1464 -0
- 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-spec-design/SKILL.md +336 -0
- package/skills/a2h-spec-design/scripts/inspect_spec_design_inputs.mjs +146 -0
- package/skills/a2h-spec-design/scripts/lib/py_compat.mjs +481 -0
- package/skills/a2h-spec-design/scripts/move_spec_technical_reference.mjs +159 -0
- package/skills/a2h-spec-design/scripts/resolve_module_design.mjs +102 -0
- package/skills/a2h-spec-design/scripts/validate_spec_design_output.mjs +285 -0
- package/skills/a2h-spec-design/test/golden/inspect_happy.json +20 -0
- package/skills/a2h-spec-design/test/golden/move_design.md +18 -0
- package/skills/a2h-spec-design/test/golden/move_design_crlf.md +18 -0
- package/skills/a2h-spec-design/test/golden/move_spec.md +7 -0
- package/skills/a2h-spec-design/test/golden/resolve_cases.json +36 -0
- package/skills/a2h-spec-design/test/golden/validate_issue_file.md +12 -0
- package/skills/a2h-spec-design/test/golden/validate_issues.json +57 -0
- package/skills/a2h-spec-design/test/test_spec_design_scripts.mjs +381 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +228 -0
- package/skills/a2h-spec-design-pipeline/package.json +4 -0
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +63 -0
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +69 -0
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +24 -0
- package/skills/a2h-spec-design-pipeline/references/initialization.md +57 -0
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +21 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +27 -0
- package/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +21 -0
- package/skills/a2h-spec-design-pipeline/scripts/atomic_write.ts +42 -0
- package/skills/a2h-spec-design-pipeline/scripts/audit_claims.ts +252 -0
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +77 -0
- package/skills/a2h-spec-design-pipeline/scripts/deps_ready.ts +195 -0
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +651 -0
- package/skills/a2h-spec-design-pipeline/scripts/git_baseline.ts +124 -0
- package/skills/a2h-spec-design-pipeline/scripts/inflight.mjs +944 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/bgcli.mjs +95 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +502 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_waves.ts +475 -0
- package/skills/a2h-spec-design-pipeline/scripts/reconcile.mjs +218 -0
- package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +164 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_atomic_write.ts +44 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_audit_claims.ts +301 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_bgcli.mjs +64 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_branch_landed.ts +87 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_deps_ready.ts +265 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +675 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_git_baseline.ts +105 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_inflight.mjs +452 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +375 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_waves.ts +561 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_reconcile.mjs +182 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +138 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_watchdog.mjs +289 -0
- package/skills/a2h-spec-design-pipeline/scripts/watchdog.mjs +441 -0
- package/skills/a2h-spec-generate/SKILL.md +285 -0
- package/skills/a2h-spec-generate/package.json +9 -0
- package/skills/a2h-spec-generate/references/batch-mode.md +151 -0
- package/skills/a2h-spec-generate/references/delete-blast-radius.md +3 -0
- package/skills/a2h-spec-generate/references/fusion-task-contract.md +114 -0
- package/skills/a2h-spec-generate/references/input-formats.md +27 -0
- package/skills/a2h-spec-generate/references/library-evidence.md +3 -0
- package/skills/a2h-spec-generate/references/method-discipline.md +64 -0
- package/skills/a2h-spec-generate/references/optional-gates.json +45 -0
- package/skills/a2h-spec-generate/references/recall-guide.md +83 -0
- package/skills/a2h-spec-generate/references/recall-terse.md +3 -0
- package/skills/a2h-spec-generate/references/recall-uniapp.md +10 -0
- package/skills/a2h-spec-generate/references/requirement-scope.md +122 -0
- package/skills/a2h-spec-generate/references/review-checklist.md +21 -0
- package/skills/a2h-spec-generate/references/spec-sample-complex.md +80 -0
- package/skills/a2h-spec-generate/references/spec-sample-transfer.md +43 -0
- package/skills/a2h-spec-generate/references/spec-samples.md +65 -0
- package/skills/a2h-spec-generate/references/specs.schema.json +79 -0
- package/skills/a2h-spec-generate/references/synthesis-rules.md +143 -0
- package/skills/a2h-spec-generate/references/transfer-file.md +5 -0
- package/skills/a2h-spec-generate/references/transfer-socket.md +5 -0
- package/skills/a2h-spec-generate/references/worker-rules.md +126 -0
- package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +514 -0
- package/skills/a2h-spec-generate/scripts/check_spec.ts +361 -0
- package/skills/a2h-spec-generate/scripts/collect-specs.mjs +470 -0
- package/skills/a2h-spec-generate/scripts/detect-project.mjs +271 -0
- package/skills/a2h-spec-generate/scripts/ensure-index.mjs +188 -0
- package/skills/a2h-spec-generate/scripts/feature-stem.mjs +150 -0
- package/skills/a2h-spec-generate/scripts/inspect-uniapp.mjs +733 -0
- package/skills/{hmos-spec-generate → a2h-spec-generate}/scripts/parse_requirements.ts +1 -1
- package/skills/a2h-spec-generate/scripts/prepare-facts.mjs +307 -0
- package/skills/a2h-spec-generate/scripts/publication-verdict.mjs +171 -0
- package/skills/a2h-spec-generate/scripts/publish-specs.mjs +280 -0
- package/skills/a2h-spec-generate/scripts/render-tasks.mjs +399 -0
- package/skills/a2h-spec-generate/scripts/report.mjs +132 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/dashboard.html +149 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-api.js +49 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-code-view.js +140 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-format.js +16 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-handoff.js +42 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-splitters.js +78 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-state.js +47 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-tree.js +194 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-virtual-list.js +118 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.css +245 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.html +99 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.js +220 -0
- package/skills/a2h-spec-generate/scripts/reqgen/package-lock.json +47 -0
- package/skills/a2h-spec-generate/scripts/reqgen/package.json +23 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/agent-render/serve.ts +95 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/callback-call-sites.ts +82 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/area-ownership.ts +496 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +2217 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/callback-flow.ts +386 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +845 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/index.ts +24 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/index.ts +22 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +572 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +580 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +1270 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/index.ts +10 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/projection.ts +804 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/render-projection.ts +51 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/android-interaction-registry.ts +286 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/builder.ts +453 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/compose-api-registry.ts +526 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/index.ts +15 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/connector/index.ts +1 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/connector/utg-inbound.ts +763 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/area-graph.ts +383 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/artifact.ts +68 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/common.ts +88 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/diagnostic.ts +64 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/gap-audit.ts +113 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/index.ts +12 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/name-traceability.ts +108 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/raw-fact.ts +377 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/req-model.ts +238 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/run.ts +134 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/semantic-completeness.ts +35 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/source-facts.ts +48 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/utg.ts +133 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/core/output-guard.ts +42 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/core/stable-id.ts +118 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/cross-area-tally-cli.ts +179 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dashboard-cli.ts +188 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dump/dump.ts +1184 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dump/index.ts +1 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dump-cli.ts +373 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +1014 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-output.ts +32 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +142 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +312 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +310 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +685 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/graph/paths.ts +575 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/homegraph-cli.ts +50 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/android-resource-resolver.ts +391 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/androidx-preference-contracts.ts +44 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +640 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/cross-area.ts +207 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/finalizer.ts +1297 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/identity.ts +186 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/index.ts +16 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/planner.ts +312 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/preference-enrichment.ts +793 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/raw-facts.ts +355 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/rules.ts +271 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/scanner.ts +666 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/schema.ts +365 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/stable-key.ts +144 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +301 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +923 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/uniapp-utg-adapter.ts +543 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/xml-adapter.ts +262 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/assemble.ts +2079 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +157 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +809 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/index.ts +17 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/io.ts +165 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +806 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/query.ts +360 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/seeds.ts +218 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/spec-bindings-sidecar.ts +240 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +359 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model-cli.ts +500 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/pipeline/index.ts +7 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/pipeline/output.ts +307 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +172 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-cov/index.ts +1 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-cov/source-cov.ts +176 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1039 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/area-graph.ts +490 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/index.ts +23 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-model.ts +957 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +248 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/semantic-area-graph.ts +1600 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/types.ts +10 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/artifact-data.ts +201 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-api.ts +74 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-code-view.ts +180 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-format.ts +18 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-handoff.ts +55 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-splitters.ts +78 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-state.ts +66 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-tree.ts +232 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-virtual-list.ts +179 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz.ts +240 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/contracts.d.ts +86 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/index.ts +3 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/server.ts +239 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/source-project.ts +316 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz-cli.ts +200 -0
- 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/fusion-area-facts.test.ts +576 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +290 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1323 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +574 -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 +831 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +548 -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 +396 -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 +298 -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/tsconfig.json +16 -0
- package/skills/a2h-spec-generate/scripts/reqgen/tsconfig.viz-client.json +12 -0
- package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +632 -0
- package/skills/a2h-spec-generate/test/check-spec.test.ts +200 -0
- package/skills/a2h-spec-generate/test/collect-specs.test.mjs +538 -0
- package/skills/a2h-spec-generate/test/detect-project.test.mjs +37 -0
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +45 -0
- package/skills/a2h-spec-generate/test/feature-stem.test.mjs +147 -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/publication-verdict.test.mjs +157 -0
- package/skills/a2h-spec-generate/test/publish-specs.test.mjs +282 -0
- package/skills/a2h-spec-generate/test/render-tasks.test.mjs +593 -0
- package/skills/a2h-utg-explorer/SKILL.md +120 -0
- package/skills/a2h-utg-explorer/assets/final_viewer.html +64 -0
- package/skills/a2h-utg-explorer/assets/u2.LICENSE +21 -0
- package/skills/a2h-utg-explorer/assets/u2.NOTICE +25 -0
- package/skills/a2h-utg-explorer/assets/u2.jar +0 -0
- package/skills/a2h-utg-explorer/references/architecture.md +270 -0
- package/skills/a2h-utg-explorer/references/protocol.md +9 -0
- package/skills/a2h-utg-explorer/scripts/app_settings.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/audit.mjs +167 -0
- package/skills/a2h-utg-explorer/scripts/close_phases.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +749 -0
- package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +597 -0
- package/skills/a2h-utg-explorer/scripts/device_health.mjs +227 -0
- package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +276 -0
- package/skills/a2h-utg-explorer/scripts/evidence.mjs +108 -0
- package/skills/a2h-utg-explorer/scripts/final_utg.mjs +376 -0
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +258 -0
- package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +170 -0
- package/skills/a2h-utg-explorer/scripts/recover.mjs +467 -0
- package/skills/a2h-utg-explorer/scripts/recover_b.mjs +542 -0
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +302 -0
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +203 -0
- package/skills/a2h-utg-explorer/scripts/report.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +831 -0
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +137 -0
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +45 -0
- package/skills/a2h-utg-explorer/scripts/tests/compose_identity.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 +223 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +88 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +187 -0
- package/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +136 -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/generalization_fixes.test.mjs +251 -0
- package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +42 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +162 -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 +204 -0
- package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +355 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover.test.mjs +212 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +207 -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 +453 -0
- package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +131 -0
- package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +229 -0
- package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +321 -0
- package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -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/_device_io.mjs +244 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/_py.mjs +2097 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +1213 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/attest.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/chain.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/coverage.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/device_lock.mjs +46 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +1136 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +1513 -0
- package/skills/a2h-utg-explorer/scripts/variant.mjs +75 -0
- package/skills/a2h-utg-explorer/scripts/worklist_parts.mjs +122 -0
- package/skills/a2h-utg-static/SKILL.md +361 -0
- package/skills/a2h-utg-static/config.json +19 -0
- package/skills/a2h-utg-static/references/extractors.md +217 -0
- package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +248 -0
- package/skills/a2h-utg-static/references/view-interactions.md +215 -0
- package/skills/a2h-utg-static/scripts/_graph.mjs +361 -0
- package/skills/a2h-utg-static/scripts/_py.mjs +2177 -0
- package/skills/a2h-utg-static/scripts/_spawn.mjs +45 -0
- package/skills/a2h-utg-static/scripts/activity_nav.mjs +738 -0
- package/skills/a2h-utg-static/scripts/activity_widgets.mjs +254 -0
- package/skills/a2h-utg-static/scripts/adapter_nav.mjs +229 -0
- package/skills/a2h-utg-static/scripts/androidfragment_nav.mjs +208 -0
- package/skills/a2h-utg-static/scripts/assemble.mjs +2065 -0
- package/skills/a2h-utg-static/scripts/audit.mjs +268 -0
- package/skills/a2h-utg-static/scripts/carry_answers.mjs +201 -0
- package/skills/a2h-utg-static/scripts/click_paths.mjs +594 -0
- package/skills/a2h-utg-static/scripts/compose_body_text.mjs +172 -0
- package/skills/a2h-utg-static/scripts/compose_merge.mjs +263 -0
- package/skills/a2h-utg-static/scripts/compose_nav.mjs +1216 -0
- package/skills/a2h-utg-static/scripts/compose_navbar_nav.mjs +238 -0
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +2760 -0
- package/skills/a2h-utg-static/scripts/compose_titles.mjs +365 -0
- package/skills/a2h-utg-static/scripts/compose_widgets.mjs +498 -0
- package/skills/a2h-utg-static/scripts/dialog_listener_nav.mjs +237 -0
- package/skills/a2h-utg-static/scripts/dialogshow_nav.mjs +308 -0
- package/skills/a2h-utg-static/scripts/fragfactory_nav.mjs +170 -0
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +1136 -0
- package/skills/a2h-utg-static/scripts/guard_subjects.mjs +162 -0
- package/skills/a2h-utg-static/scripts/hg_query.mjs +137 -0
- package/skills/a2h-utg-static/scripts/host_resolve.mjs +393 -0
- package/skills/a2h-utg-static/scripts/hybrid_bundle.mjs +165 -0
- package/skills/a2h-utg-static/scripts/hybrid_pages.mjs +713 -0
- package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +660 -0
- package/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
- package/skills/a2h-utg-static/scripts/io_utils.mjs +59 -0
- package/skills/a2h-utg-static/scripts/label_resolve.mjs +864 -0
- package/skills/a2h-utg-static/scripts/launch_extras.mjs +91 -0
- package/skills/a2h-utg-static/scripts/layout_resolve.mjs +148 -0
- package/skills/a2h-utg-static/scripts/manifest.mjs +483 -0
- package/skills/a2h-utg-static/scripts/measure/measure_corpus.mjs +297 -0
- package/skills/a2h-utg-static/scripts/measure/measure_guards.mjs +98 -0
- package/skills/a2h-utg-static/scripts/media_browse_nav.mjs +356 -0
- package/skills/a2h-utg-static/scripts/menu_nav.mjs +603 -0
- package/skills/a2h-utg-static/scripts/navactions_nav.mjs +255 -0
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +453 -0
- package/skills/a2h-utg-static/scripts/orphan_overlay_nav.mjs +89 -0
- package/skills/a2h-utg-static/scripts/phase_plan.mjs +108 -0
- package/skills/a2h-utg-static/scripts/phase_planner.mjs +119 -0
- package/skills/a2h-utg-static/scripts/plaindialog_nav.mjs +411 -0
- package/skills/a2h-utg-static/scripts/preference_nav.mjs +761 -0
- package/skills/a2h-utg-static/scripts/preference_widgets.mjs +142 -0
- package/skills/a2h-utg-static/scripts/presenter_nav.mjs +490 -0
- package/skills/a2h-utg-static/scripts/registry_nav.mjs +288 -0
- package/skills/a2h-utg-static/scripts/run_pipeline.mjs +870 -0
- package/skills/a2h-utg-static/scripts/scope_utils.mjs +430 -0
- package/skills/a2h-utg-static/scripts/screen_merge.mjs +287 -0
- package/skills/a2h-utg-static/scripts/screen_nav.mjs +279 -0
- package/skills/a2h-utg-static/scripts/single_host_nav.mjs +291 -0
- package/skills/a2h-utg-static/scripts/starter_nav.mjs +198 -0
- package/skills/a2h-utg-static/scripts/state_guard.mjs +579 -0
- package/skills/a2h-utg-static/scripts/static_prior.mjs +904 -0
- package/skills/a2h-utg-static/scripts/tests/_zipw.mjs +28 -0
- package/skills/a2h-utg-static/scripts/tests/probe_autoload.mjs +108 -0
- package/skills/a2h-utg-static/scripts/tests/probe_layout_fragments.mjs +90 -0
- package/skills/a2h-utg-static/scripts/tests/probe_unknown_scope.mjs +61 -0
- package/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +1261 -0
- package/skills/a2h-utg-static/scripts/tests/test_activity_alias_launcher.mjs +90 -0
- package/skills/a2h-utg-static/scripts/tests/test_activity_supertype_chain.mjs +106 -0
- package/skills/a2h-utg-static/scripts/tests/test_bottom_sheet_container.mjs +58 -0
- package/skills/a2h-utg-static/scripts/tests/test_branch_guard.mjs +19 -0
- package/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +30 -0
- package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +103 -0
- package/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +60 -0
- package/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +111 -0
- package/skills/a2h-utg-static/scripts/tests/test_commit_scope.mjs +113 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_file_private_route.mjs +117 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_nested_graph.mjs +166 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_route_holder_collision.mjs +112 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +267 -0
- package/skills/a2h-utg-static/scripts/tests/test_custom_source_root.mjs +71 -0
- package/skills/a2h-utg-static/scripts/tests/test_defensive_null_guard.mjs +77 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialog_orphan_entries.mjs +99 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialog_page_owner.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialogshow_builder_forms.mjs +96 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialogshow_java_factory.mjs +37 -0
- package/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +42 -0
- package/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +140 -0
- package/skills/a2h-utg-static/scripts/tests/test_edge_dedupe_by_gesture.mjs +111 -0
- package/skills/a2h-utg-static/scripts/tests/test_edge_provenance_lint.mjs +70 -0
- package/skills/a2h-utg-static/scripts/tests/test_enclosing_gesture.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_external_surface_roots.mjs +43 -0
- package/skills/a2h-utg-static/scripts/tests/test_find_package_indirect.mjs +67 -0
- package/skills/a2h-utg-static/scripts/tests/test_forwarding_wrapper.mjs +38 -0
- package/skills/a2h-utg-static/scripts/tests/test_fragment_containment.mjs +85 -0
- package/skills/a2h-utg-static/scripts/tests/test_fragment_helper_trigger.mjs +92 -0
- package/skills/a2h-utg-static/scripts/tests/test_graph.mjs +55 -0
- package/skills/a2h-utg-static/scripts/tests/test_guard_clause.mjs +86 -0
- package/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +119 -0
- package/skills/a2h-utg-static/scripts/tests/test_host_kind_by_chain.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +74 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +181 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +293 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +118 -0
- package/skills/a2h-utg-static/scripts/tests/test_interaction_sites.mjs +272 -0
- package/skills/a2h-utg-static/scripts/tests/test_item_data_instance.mjs +51 -0
- package/skills/a2h-utg-static/scripts/tests/test_kotlin_fn_spans.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +187 -0
- package/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +70 -0
- package/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +67 -0
- package/skills/a2h-utg-static/scripts/tests/test_layout_declared_fragment.mjs +103 -0
- package/skills/a2h-utg-static/scripts/tests/test_listener_call_forms.mjs +79 -0
- package/skills/a2h-utg-static/scripts/tests/test_listener_receiver_binding.mjs +47 -0
- package/skills/a2h-utg-static/scripts/tests/test_manifest_exported_default.mjs +40 -0
- package/skills/a2h-utg-static/scripts/tests/test_manifest_filters_modules.mjs +84 -0
- package/skills/a2h-utg-static/scripts/tests/test_manifest_srcfile.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_namespace.mjs +33 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +44 -0
- package/skills/a2h-utg-static/scripts/tests/test_multiple_entry_contracts.mjs +80 -0
- package/skills/a2h-utg-static/scripts/tests/test_nav_graph_xml.mjs +35 -0
- package/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +42 -0
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +85 -0
- package/skills/a2h-utg-static/scripts/tests/test_node_id_collision.mjs +57 -0
- package/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +62 -0
- package/skills/a2h-utg-static/scripts/tests/test_out_of_scope_and_settings.mjs +72 -0
- package/skills/a2h-utg-static/scripts/tests/test_overload_and_climb.mjs +86 -0
- package/skills/a2h-utg-static/scripts/tests/test_pager_page_source.mjs +78 -0
- package/skills/a2h-utg-static/scripts/tests/test_pager_position_zero.mjs +65 -0
- package/skills/a2h-utg-static/scripts/tests/test_pager_variant_guard.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +107 -0
- package/skills/a2h-utg-static/scripts/tests/test_plain_dialog_nodes.mjs +167 -0
- package/skills/a2h-utg-static/scripts/tests/test_plaindialog_shared_anchor.mjs +117 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_click_nav.mjs +98 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_host_binding.mjs +87 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_nesting.mjs +183 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +48 -0
- package/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +41 -0
- package/skills/a2h-utg-static/scripts/tests/test_resolver_tier_parity.mjs +126 -0
- package/skills/a2h-utg-static/scripts/tests/test_result_launcher.mjs +142 -0
- package/skills/a2h-utg-static/scripts/tests/test_review_fixes.mjs +135 -0
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +66 -0
- package/skills/a2h-utg-static/scripts/tests/test_same_name_decl_scope.mjs +236 -0
- package/skills/a2h-utg-static/scripts/tests/test_scope_utils.mjs +85 -0
- package/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +148 -0
- package/skills/a2h-utg-static/scripts/tests/test_shared_overlay_split.mjs +63 -0
- package/skills/a2h-utg-static/scripts/tests/test_slug_parity.mjs +58 -0
- package/skills/a2h-utg-static/scripts/tests/test_starter_node_id.mjs +41 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_arity.mjs +109 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_commented_candidates.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_model_gates.mjs +127 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +130 -0
- package/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +51 -0
- package/skills/a2h-utg-static/scripts/tests/test_template_method_layout.mjs +81 -0
- package/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +58 -0
- package/skills/a2h-utg-static/scripts/tests/test_trigger_id_spelling.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_action_override.mjs +91 -0
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +110 -0
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_nl_hint_key.mjs +89 -0
- package/skills/a2h-utg-static/scripts/tests/test_uiless_host_fold.mjs +98 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +231 -0
- package/skills/a2h-utg-static/scripts/tests/test_view_click_refs.mjs +104 -0
- package/skills/a2h-utg-static/scripts/tests/test_view_id_label.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_view_interactions.mjs +346 -0
- package/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +273 -0
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +98 -0
- package/skills/a2h-utg-static/scripts/tests/test_widget_class_scope.mjs +92 -0
- package/skills/a2h-utg-static/scripts/tests/test_window_nav_kotlin.mjs +158 -0
- package/skills/a2h-utg-static/scripts/tests/test_worklist_parts.mjs +65 -0
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +1119 -0
- package/skills/a2h-utg-static/scripts/uniapp_widgets.mjs +244 -0
- package/skills/a2h-utg-static/scripts/utg_html.mjs +721 -0
- package/skills/a2h-utg-static/scripts/view_interactions.mjs +799 -0
- package/skills/a2h-utg-static/scripts/view_widgets.mjs +512 -0
- package/skills/a2h-utg-static/scripts/viewpage_nav.mjs +485 -0
- package/skills/a2h-utg-static/scripts/vm_nav.mjs +422 -0
- package/skills/a2h-utg-static/scripts/window_nav.mjs +240 -0
- package/skills/a2h-utg-static/scripts/worklist_parts.mjs +154 -0
- package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +769 -0
- package/skills/a2h-utg-static/tools/package.json +3 -0
- package/README.md +0 -427
- package/agents/logic-coder.md +0 -224
- package/agents/logic-context-builder.md +0 -212
- package/agents/scripts/hmos-precheck/backends/arkts.mjs +0 -567
- package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +0 -159
- package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +0 -398
- package/agents/scripts/hmos-precheck/backends/codelinter.mjs +0 -250
- package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +0 -321
- package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +0 -247
- package/agents/scripts/hmos-precheck/core/config.mjs +0 -184
- package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +0 -20
- package/agents/scripts/hmos-precheck/core/process_adapter.mjs +0 -47
- package/agents/scripts/hmos-precheck/core/project_catalog.mjs +0 -50
- package/agents/scripts/hmos-precheck/core/result_projection.mjs +0 -147
- package/agents/scripts/hmos-precheck/core/scope_plan.mjs +0 -131
- package/agents/scripts/hmos-precheck/core/sdk_context.mjs +0 -67
- package/agents/scripts/hmos-precheck/docs/architecture.md +0 -37
- package/agents/scripts/hmos-precheck/docs/performance-optimization.md +0 -28
- package/agents/scripts/hmos-precheck/docs/upstream-reference.json +0 -19
- package/agents/scripts/hmos-precheck/docs/validation.md +0 -50
- package/agents/scripts/hmos-precheck/index.mjs +0 -17
- package/agents/scripts/hmos-precheck/invocation.mjs +0 -231
- package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +0 -32
- package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +0 -64
- package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +0 -59
- package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +0 -54
- package/agents/scripts/platform_query.mjs +0 -626
- package/agents/scripts/platform_query.test.mjs +0 -422
- package/agents/self-test-fixer.md +0 -298
- package/agents/self-tester.md +0 -376
- package/agents/test-case-generation-generator.md +0 -317
- package/agents/test-case-generation-validator.md +0 -231
- package/dist/cli/config-store.js +0 -390
- package/dist/cli/config.js +0 -46
- package/dist/cli/env-vars.js +0 -127
- package/dist/cli/index.js +0 -56
- package/dist/cli/init.js +0 -1194
- package/dist/cli/uninstall.js +0 -427
- package/dist/utils/regex.js +0 -8
- package/env-requirements.json +0 -178
- package/resource/choose_editor.png +0 -0
- package/resource/convert_pipeline_process.svg +0 -103
- package/resource/project_architecture.svg +0 -122
- 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/hmos-batch-ui-align/SKILL.md +0 -413
- package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +0 -1592
- package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +0 -752
- package/skills/hmos-convert-pipeline/SKILL.md +0 -476
- package/skills/hmos-incremental-ui-align/README.md +0 -251
- package/skills/hmos-incremental-ui-align/SKILL.md +0 -375
- package/skills/hmos-incremental-ui-align/diff_analysis.md +0 -53
- package/skills/hmos-incremental-ui-align/page_align.md +0 -62
- package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +0 -38
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +0 -648
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +0 -2089
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +0 -1033
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +0 -1183
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +0 -576
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +0 -297
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +0 -395
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +0 -903
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +0 -106
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +0 -1178
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217V1.md +0 -911
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +0 -355
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +0 -11
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +0 -206
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +0 -373
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +0 -158
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +0 -750
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +0 -1704
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +0 -1012
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +0 -164
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +0 -840
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +0 -856
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +0 -83
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +0 -294
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +0 -1220
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +0 -47
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +0 -840
- package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +0 -74
- package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +0 -34
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +0 -2533
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +0 -555
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +0 -117
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +0 -937
- package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +0 -343
- package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +0 -76
- package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +0 -977
- package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +0 -188
- package/skills/hmos-integration-test/README.md +0 -300
- package/skills/hmos-integration-test/SKILL.md +0 -397
- package/skills/hmos-resources-convert/SKILL.md +0 -891
- package/skills/hmos-spec-generate/SKILL.md +0 -404
- package/skills/hmos-test-case-generation/README.md +0 -241
- package/skills/hmos-test-case-generation/SKILL.md +0 -324
- package/skills/hmos-test-case-generation/references/contract.md +0 -315
- package/skills/hmos-test-case-generation/references/review-notes-template.md +0 -84
- package/skills/hmos-test-case-generation/references/ui-elements-schema.md +0 -142
- package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +0 -550
- package/skills/hmos-test-case-generation/tools/validate.ts +0 -1312
- package/tools/bfs-crawl/README.md +0 -73
- package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +0 -1662
- package/tools/test-tools/autotest/config.ts +0 -175
- package/tools/test-tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
- package/tools/test-tools/autotest/docs/README.md +0 -266
- package/tools/test-tools/autotest/docs/testcases_schema.md +0 -143
- package/tools/test-tools/autotest/engine/batch-launcher.ts +0 -327
- package/tools/test-tools/autotest/engine/report-tool.ts +0 -773
- package/tools/test-tools/autotest/engine/self-test-runner.ts +0 -961
- package/tools/test-tools/autotest/engine/testcases-tool.ts +0 -246
- package/tools/test-tools/autotest/paths.ts +0 -41
- package/tools/test-tools/autotest/resolve-metadata-tool.ts +0 -143
- package/tools/test-tools/autotest/runner/logger.ts +0 -45
- package/tools/test-tools/autotest/runner/process-utils.ts +0 -41
- package/tools/test-tools/autotest/validate.ts +0 -167
- /package/skills/{hmos-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md" → a2h-arch-generate/references/arkts-mvvm-v2.md} +0 -0
- /package/{README.en.md → skills/a2h-arch-generate/scripts/module_create/har/consumer-rules.txt} +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md" +0 -0
- /package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2 → a2h-batch-ui-align/references/mvvm-v2}/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md" +0 -0
- /package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/references/arkts-strict-patterns.md +0 -0
- /package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/references/known-patterns.md +0 -0
- /package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/references/rdb-entity-pattern.md +0 -0
- /package/skills/{hmos-resources-convert → a2h-resource-convert}/references/dependency-analysis-rules.md +0 -0
- /package/skills/{hmos-resources-convert → a2h-resource-convert}/scripts/svg_fidelity_check.ts +0 -0
- /package/skills/{hmos-spec-generate → a2h-spec-generate}/template/REQ.txt +0 -0
- /package/skills/{hmos-spec-generate → a2h-spec-generate}/template/REQ.xlsx +0 -0
|
@@ -0,0 +1,2217 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Action,
|
|
3
|
+
AnalysisContext,
|
|
4
|
+
Area,
|
|
5
|
+
AreaGraphDocument,
|
|
6
|
+
AreaGraphView,
|
|
7
|
+
AreaPath,
|
|
8
|
+
BehaviorEffectData,
|
|
9
|
+
ConditionAlternative,
|
|
10
|
+
Control,
|
|
11
|
+
DescriptionFact,
|
|
12
|
+
Edge,
|
|
13
|
+
Effect,
|
|
14
|
+
EntryPoint,
|
|
15
|
+
ExternalEndpoint,
|
|
16
|
+
RawFactDataByKind,
|
|
17
|
+
RawFactKind,
|
|
18
|
+
SourceFact,
|
|
19
|
+
SourceFactsArtifact,
|
|
20
|
+
SupportedValue,
|
|
21
|
+
UiElementData,
|
|
22
|
+
UnresolvedItem
|
|
23
|
+
} from "../../contracts/index.ts";
|
|
24
|
+
import { withAreaGraphFlatViews } from "../../contracts/index.ts";
|
|
25
|
+
import { createStableId } from "../../core/stable-id.ts";
|
|
26
|
+
import { computePaths } from "../../graph/paths.ts";
|
|
27
|
+
import { validateAreaGraph } from "../../validation/index.ts";
|
|
28
|
+
import {
|
|
29
|
+
codeNameCandidate,
|
|
30
|
+
componentIdentifierName,
|
|
31
|
+
controlNameCandidates,
|
|
32
|
+
literalNameCandidate,
|
|
33
|
+
resolveNameCandidates
|
|
34
|
+
} from "../names/policy.ts";
|
|
35
|
+
import {
|
|
36
|
+
CallbackFlowTraversal
|
|
37
|
+
} from "./callback-flow.ts";
|
|
38
|
+
import {
|
|
39
|
+
resolveComposeRouteArea,
|
|
40
|
+
resolveAreaOwnership
|
|
41
|
+
} from "./area-ownership.ts";
|
|
42
|
+
import { applyComponentVariants } from "./component-variants.ts";
|
|
43
|
+
|
|
44
|
+
function factsOfKind<K extends RawFactKind>(
|
|
45
|
+
artifact: SourceFactsArtifact,
|
|
46
|
+
kind: K
|
|
47
|
+
): SourceFact<K>[] {
|
|
48
|
+
return artifact.facts.filter(
|
|
49
|
+
(fact): fact is SourceFact<K> => fact.kind === kind
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function resolved<T>(
|
|
54
|
+
value: T,
|
|
55
|
+
supportRefs: readonly string[],
|
|
56
|
+
confidence: "high" | "medium" | "low" = "high"
|
|
57
|
+
): SupportedValue<T> {
|
|
58
|
+
return {
|
|
59
|
+
status: "resolved",
|
|
60
|
+
value,
|
|
61
|
+
confidence,
|
|
62
|
+
supportRefs: [...new Set(supportRefs)].sort()
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function graphId(
|
|
67
|
+
namespace: string,
|
|
68
|
+
caseId: string,
|
|
69
|
+
entityKind: string,
|
|
70
|
+
identity: string
|
|
71
|
+
): string {
|
|
72
|
+
return createStableId({
|
|
73
|
+
namespace,
|
|
74
|
+
caseId,
|
|
75
|
+
entityKind,
|
|
76
|
+
identity: [{ kind: "semantic-key", value: identity }]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function inferredTrigger(data: UiElementData): string {
|
|
81
|
+
if (
|
|
82
|
+
data.elementType === "toggle" ||
|
|
83
|
+
data.elementType === "switch" ||
|
|
84
|
+
data.elementType === "checkbox" ||
|
|
85
|
+
data.elementType === "radio-button" ||
|
|
86
|
+
data.elementType === "toggle-button"
|
|
87
|
+
) return "toggle";
|
|
88
|
+
if (
|
|
89
|
+
data.elementType === "text-input" ||
|
|
90
|
+
data.elementType === "text-field"
|
|
91
|
+
) return "text-input";
|
|
92
|
+
return "click";
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function repeatedControlName(areaName: string | undefined): string {
|
|
96
|
+
if (!areaName) return "List item";
|
|
97
|
+
return /\p{Script=Han}/u.test(areaName)
|
|
98
|
+
? `${areaName}列表项`
|
|
99
|
+
: `${areaName} item`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function genericMenuOpenerName(value: string): boolean {
|
|
103
|
+
const compact = value.replace(/[^\p{Letter}\p{Number}]/gu, "")
|
|
104
|
+
.toLocaleLowerCase("en-US");
|
|
105
|
+
return new Set([
|
|
106
|
+
"menu",
|
|
107
|
+
"more",
|
|
108
|
+
"morehorizontal",
|
|
109
|
+
"morehoriz",
|
|
110
|
+
"morevertical",
|
|
111
|
+
"morevert",
|
|
112
|
+
"overflow",
|
|
113
|
+
"更多",
|
|
114
|
+
"菜单"
|
|
115
|
+
]).has(compact);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function contextualMenuName(value: string): string {
|
|
119
|
+
const normalized = value.trim();
|
|
120
|
+
if (/菜单$/u.test(normalized) || /(?:^|\s)menu$/iu.test(normalized)) {
|
|
121
|
+
return normalized;
|
|
122
|
+
}
|
|
123
|
+
return /\p{Script=Han}/u.test(normalized)
|
|
124
|
+
? `${normalized}菜单`
|
|
125
|
+
: `${normalized} menu`;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function androidExternalTargetName(
|
|
129
|
+
intentAction: string | undefined
|
|
130
|
+
): string | undefined {
|
|
131
|
+
switch (intentAction) {
|
|
132
|
+
case "android.intent.action.OPEN_DOCUMENT":
|
|
133
|
+
case "android.intent.action.GET_CONTENT":
|
|
134
|
+
return "Android 系统文件选择器";
|
|
135
|
+
case "android.intent.action.OPEN_DOCUMENT_TREE":
|
|
136
|
+
return "Android 系统文件夹选择器";
|
|
137
|
+
case "android.intent.action.CREATE_DOCUMENT":
|
|
138
|
+
return "Android 系统文件保存界面";
|
|
139
|
+
default:
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function effectText(
|
|
145
|
+
data: BehaviorEffectData,
|
|
146
|
+
targetName?: string
|
|
147
|
+
): string {
|
|
148
|
+
const sourceDescription = data.description?.trim();
|
|
149
|
+
if (sourceDescription) return sourceDescription;
|
|
150
|
+
const scalarValue = data.value === null ||
|
|
151
|
+
typeof data.value === "string" ||
|
|
152
|
+
typeof data.value === "number" ||
|
|
153
|
+
typeof data.value === "boolean"
|
|
154
|
+
? String(data.value)
|
|
155
|
+
: undefined;
|
|
156
|
+
switch (data.effectKind) {
|
|
157
|
+
case "navigate-area":
|
|
158
|
+
return targetName ? `进入 ${targetName}` : "进入目标区域";
|
|
159
|
+
case "open-external":
|
|
160
|
+
return targetName ? `打开 ${targetName}` : "打开 App 外目标";
|
|
161
|
+
case "update-state":
|
|
162
|
+
if (data.stateKey?.split("\u0000").includes("preference-key")) {
|
|
163
|
+
return "更新该设置的选中值";
|
|
164
|
+
}
|
|
165
|
+
return scalarValue === undefined
|
|
166
|
+
? "更新当前状态"
|
|
167
|
+
: `将当前状态更新为“${scalarValue}”`;
|
|
168
|
+
case "show-feedback":
|
|
169
|
+
return scalarValue === undefined
|
|
170
|
+
? "显示短暂提示"
|
|
171
|
+
: `显示短暂提示“${scalarValue}”`;
|
|
172
|
+
case "business-action":
|
|
173
|
+
return "执行对应业务操作";
|
|
174
|
+
case "show-surface":
|
|
175
|
+
return targetName ? `显示 ${targetName}` : "显示交互区域";
|
|
176
|
+
case "close-surface":
|
|
177
|
+
return "关闭当前区域";
|
|
178
|
+
case "input":
|
|
179
|
+
return "接收并处理用户输入";
|
|
180
|
+
case "unknown":
|
|
181
|
+
return "操作结果待确认";
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function sorted<T extends { readonly id: string }>(values: T[]): T[] {
|
|
186
|
+
return values.sort((left, right) =>
|
|
187
|
+
left.id.localeCompare(right.id, "en")
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function uniqueSorted(values: readonly string[]): string[] {
|
|
192
|
+
return [...new Set(values)].sort((left, right) =>
|
|
193
|
+
left.localeCompare(right, "en")
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function canonicalSemanticValue(value: unknown): string {
|
|
198
|
+
if (Array.isArray(value)) {
|
|
199
|
+
return `[${value.map(canonicalSemanticValue).join(",")}]`;
|
|
200
|
+
}
|
|
201
|
+
if (value !== null && typeof value === "object") {
|
|
202
|
+
return `{${Object.entries(value)
|
|
203
|
+
.sort(([left], [right]) => left.localeCompare(right, "en"))
|
|
204
|
+
.map(([key, child]) =>
|
|
205
|
+
`${JSON.stringify(key)}:${canonicalSemanticValue(child)}`
|
|
206
|
+
)
|
|
207
|
+
.join(",")}}`;
|
|
208
|
+
}
|
|
209
|
+
return JSON.stringify(value);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function stateKeyDisplayName(value: string): string {
|
|
213
|
+
const parts = value.split("\u0000");
|
|
214
|
+
const preferenceKeyIndex = parts.indexOf("preference-key");
|
|
215
|
+
if (
|
|
216
|
+
preferenceKeyIndex >= 0 &&
|
|
217
|
+
parts[preferenceKeyIndex + 1]?.trim()
|
|
218
|
+
) {
|
|
219
|
+
return parts[preferenceKeyIndex + 1].trim();
|
|
220
|
+
}
|
|
221
|
+
if (parts[0] === "receiver" && parts[3]?.trim()) {
|
|
222
|
+
return parts[3].trim();
|
|
223
|
+
}
|
|
224
|
+
if (parts[2]?.trim()) return parts[2].trim();
|
|
225
|
+
if (parts[1]?.trim()) return parts[1].trim();
|
|
226
|
+
return value;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function normalizedUiPropertyName(property: string): string {
|
|
230
|
+
const leaf = property.trim().split(/[.:/]/u).at(-1) ?? property;
|
|
231
|
+
return leaf.replace(/[^a-z0-9]/giu, "").toLowerCase();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function staticEnabledFor(
|
|
235
|
+
uiFactRef: string,
|
|
236
|
+
propertyFacts: readonly SourceFact<"ui-property">[]
|
|
237
|
+
): SupportedValue<boolean> | undefined {
|
|
238
|
+
const enabledFacts = propertyFacts.filter((property) =>
|
|
239
|
+
property.data.ownerKey === uiFactRef &&
|
|
240
|
+
normalizedUiPropertyName(property.data.property) === "enabled" &&
|
|
241
|
+
typeof property.data.value === "boolean"
|
|
242
|
+
);
|
|
243
|
+
if (enabledFacts.length === 0) return undefined;
|
|
244
|
+
const values = new Set(
|
|
245
|
+
enabledFacts.map((property) => property.data.value as boolean)
|
|
246
|
+
);
|
|
247
|
+
if (values.size !== 1) {
|
|
248
|
+
throw new Error(
|
|
249
|
+
`Area graph property invariant for UI Element ${uiFactRef}: ` +
|
|
250
|
+
"static enabled properties disagree."
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
const confidenceRank = { high: 2, medium: 1, low: 0 } as const;
|
|
254
|
+
const confidence = enabledFacts.reduce<"high" | "medium" | "low">(
|
|
255
|
+
(weakest, property) =>
|
|
256
|
+
confidenceRank[property.confidence] < confidenceRank[weakest]
|
|
257
|
+
? property.confidence
|
|
258
|
+
: weakest,
|
|
259
|
+
"high"
|
|
260
|
+
);
|
|
261
|
+
return resolved(
|
|
262
|
+
enabledFacts[0].data.value as boolean,
|
|
263
|
+
enabledFacts.map((property) => property.id),
|
|
264
|
+
confidence
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
interface StableDescriptionCandidate {
|
|
269
|
+
readonly value: string;
|
|
270
|
+
readonly sourceFactRefs: readonly string[];
|
|
271
|
+
readonly confidence: "high" | "medium" | "low";
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function descriptionText(value: unknown): string | undefined {
|
|
275
|
+
if (typeof value !== "string") return undefined;
|
|
276
|
+
const normalized = value.trim().replace(/\s+/gu, " ");
|
|
277
|
+
return normalized.length > 0 && /[\p{Letter}\p{Number}]/u.test(normalized)
|
|
278
|
+
? normalized
|
|
279
|
+
: undefined;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function sameDescriptionText(left: string, right: string): boolean {
|
|
283
|
+
return left.toLocaleLowerCase("en-US") ===
|
|
284
|
+
right.toLocaleLowerCase("en-US");
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function weakestDescriptionConfidence(
|
|
288
|
+
candidates: readonly StableDescriptionCandidate[]
|
|
289
|
+
): "high" | "medium" | "low" {
|
|
290
|
+
const rank = { high: 2, medium: 1, low: 0 } as const;
|
|
291
|
+
return candidates.reduce<"high" | "medium" | "low">(
|
|
292
|
+
(weakest, candidate) =>
|
|
293
|
+
rank[candidate.confidence] < rank[weakest]
|
|
294
|
+
? candidate.confidence
|
|
295
|
+
: weakest,
|
|
296
|
+
"high"
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function stableDescriptionFacts(
|
|
301
|
+
caseId: string,
|
|
302
|
+
areaRef: string,
|
|
303
|
+
componentRefs: ReadonlySet<string>,
|
|
304
|
+
areaName: SupportedValue<string>,
|
|
305
|
+
uiFacts: readonly SourceFact<"ui-element">[],
|
|
306
|
+
propertyFacts: readonly SourceFact<"ui-property">[],
|
|
307
|
+
boundUiFactRefs: ReadonlySet<string>
|
|
308
|
+
): DescriptionFact[] {
|
|
309
|
+
const uiById = new Map(uiFacts.map((fact) => [fact.id, fact]));
|
|
310
|
+
const runtimeContentOwners = new Set(propertyFacts.flatMap((property) =>
|
|
311
|
+
normalizedUiPropertyName(property.data.property) === "runtimecontent" &&
|
|
312
|
+
property.data.value === true
|
|
313
|
+
? [property.data.ownerKey]
|
|
314
|
+
: []
|
|
315
|
+
));
|
|
316
|
+
const candidates: StableDescriptionCandidate[] = [];
|
|
317
|
+
|
|
318
|
+
for (const fact of uiFacts) {
|
|
319
|
+
const value = descriptionText(fact.data.visibleText);
|
|
320
|
+
if (
|
|
321
|
+
!value ||
|
|
322
|
+
fact.data.actionable ||
|
|
323
|
+
boundUiFactRefs.has(fact.id) ||
|
|
324
|
+
!componentRefs.has(fact.data.ownerKey) ||
|
|
325
|
+
runtimeContentOwners.has(fact.id)
|
|
326
|
+
) continue;
|
|
327
|
+
candidates.push({
|
|
328
|
+
value,
|
|
329
|
+
sourceFactRefs: [fact.id],
|
|
330
|
+
confidence: fact.confidence
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
for (const property of propertyFacts) {
|
|
335
|
+
const value = descriptionText(property.data.value);
|
|
336
|
+
if (!value) continue;
|
|
337
|
+
const normalizedProperty = normalizedUiPropertyName(
|
|
338
|
+
property.data.property
|
|
339
|
+
);
|
|
340
|
+
const stableProperty =
|
|
341
|
+
property.data.property.startsWith("stable-content:") ||
|
|
342
|
+
normalizedProperty === "stablecontent";
|
|
343
|
+
if (!stableProperty && normalizedProperty !== "message") continue;
|
|
344
|
+
const ownedUi = uiById.get(property.data.ownerKey);
|
|
345
|
+
const ownedByArea = componentRefs.has(property.data.ownerKey) ||
|
|
346
|
+
(
|
|
347
|
+
ownedUi !== undefined &&
|
|
348
|
+
!ownedUi.data.actionable &&
|
|
349
|
+
!boundUiFactRefs.has(ownedUi.id) &&
|
|
350
|
+
componentRefs.has(ownedUi.data.ownerKey)
|
|
351
|
+
);
|
|
352
|
+
if (!ownedByArea) continue;
|
|
353
|
+
candidates.push({
|
|
354
|
+
value,
|
|
355
|
+
sourceFactRefs: [property.id],
|
|
356
|
+
confidence: property.confidence
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const areaNameValue = areaName.status === "resolved"
|
|
361
|
+
? descriptionText(areaName.value)
|
|
362
|
+
: undefined;
|
|
363
|
+
const grouped = new Map<string, StableDescriptionCandidate[]>();
|
|
364
|
+
for (const candidate of candidates) {
|
|
365
|
+
if (
|
|
366
|
+
areaNameValue &&
|
|
367
|
+
sameDescriptionText(candidate.value, areaNameValue)
|
|
368
|
+
) continue;
|
|
369
|
+
const key = candidate.value.toLocaleLowerCase("en-US");
|
|
370
|
+
const matches = grouped.get(key) ?? [];
|
|
371
|
+
matches.push(candidate);
|
|
372
|
+
grouped.set(key, matches);
|
|
373
|
+
}
|
|
374
|
+
return [...grouped.values()].map((matching) => {
|
|
375
|
+
const value = matching[0].value;
|
|
376
|
+
const sourceFactRefs = uniqueSorted(
|
|
377
|
+
matching.flatMap((candidate) => candidate.sourceFactRefs)
|
|
378
|
+
);
|
|
379
|
+
return {
|
|
380
|
+
id: graphId(
|
|
381
|
+
"description",
|
|
382
|
+
caseId,
|
|
383
|
+
"stable-content",
|
|
384
|
+
`${areaRef}\u0000${value.toLocaleLowerCase("en-US")}`
|
|
385
|
+
),
|
|
386
|
+
kind: "stable-content",
|
|
387
|
+
value: resolved(
|
|
388
|
+
value,
|
|
389
|
+
sourceFactRefs,
|
|
390
|
+
weakestDescriptionConfidence(matching)
|
|
391
|
+
),
|
|
392
|
+
sourceFactRefs
|
|
393
|
+
};
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const controlNameUnknownReasonCodes = new Set([
|
|
398
|
+
"INTRINSIC_CONTROL_NAME_UNKNOWN",
|
|
399
|
+
"INTRINSIC_COMPOSE_CONTROL_NAME_UNKNOWN"
|
|
400
|
+
]);
|
|
401
|
+
|
|
402
|
+
function sourceControlNameUnresolvedItems(
|
|
403
|
+
fact: SourceFact<"ui-element">,
|
|
404
|
+
unresolvedById: ReadonlyMap<string, UnresolvedItem>
|
|
405
|
+
): UnresolvedItem[] {
|
|
406
|
+
return uniqueSorted(fact.unresolvedRefs ?? [])
|
|
407
|
+
.map((ref) => unresolvedById.get(ref))
|
|
408
|
+
.filter((item): item is UnresolvedItem =>
|
|
409
|
+
item !== undefined &&
|
|
410
|
+
item.ownerRef === fact.id &&
|
|
411
|
+
/^(?:data\.)?(?:controlName|name)$/u.test(item.fieldPath) &&
|
|
412
|
+
controlNameUnknownReasonCodes.has(item.reasonCode)
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function sourceControlNameUnresolvedRef(
|
|
417
|
+
fact: SourceFact<"ui-element">,
|
|
418
|
+
unresolvedById: ReadonlyMap<string, UnresolvedItem>
|
|
419
|
+
): string | undefined {
|
|
420
|
+
const matches = sourceControlNameUnresolvedItems(fact, unresolvedById);
|
|
421
|
+
return matches.length === 1 ? matches[0].id : undefined;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export interface BuildAreaGraphOptions {
|
|
425
|
+
readonly maxCallDepth?: number;
|
|
426
|
+
readonly maxCallbackIterations?: number;
|
|
427
|
+
readonly maxGraphStates?: number;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export function buildAreaGraph(
|
|
431
|
+
source: SourceFactsArtifact,
|
|
432
|
+
options: BuildAreaGraphOptions = {}
|
|
433
|
+
): AreaGraphView {
|
|
434
|
+
const componentFacts = factsOfKind(source, "component");
|
|
435
|
+
const componentVariantFacts = factsOfKind(source, "component-variant");
|
|
436
|
+
const uiFacts = factsOfKind(source, "ui-element").filter(
|
|
437
|
+
(fact) => fact.data.analysisRole !== "declaration-template"
|
|
438
|
+
);
|
|
439
|
+
const bindingFacts = factsOfKind(source, "interaction-binding");
|
|
440
|
+
const boundUiFactRefs = new Set(
|
|
441
|
+
bindingFacts.map((binding) => binding.data.elementKey)
|
|
442
|
+
);
|
|
443
|
+
const callbackFacts = factsOfKind(source, "callback");
|
|
444
|
+
const callbackFlowFacts = factsOfKind(source, "callback-flow");
|
|
445
|
+
const effectFacts = factsOfKind(source, "behavior-effect");
|
|
446
|
+
const navigationFacts = factsOfKind(source, "navigation-target");
|
|
447
|
+
const conditionFacts = factsOfKind(source, "condition");
|
|
448
|
+
const conditionById = new Map(
|
|
449
|
+
conditionFacts.map((condition) => [condition.id, condition])
|
|
450
|
+
);
|
|
451
|
+
const uniqueConditionRefs = (
|
|
452
|
+
refs: readonly string[]
|
|
453
|
+
): string[] => {
|
|
454
|
+
const selectedByEvidence = new Map<string, string>();
|
|
455
|
+
for (const ref of refs) {
|
|
456
|
+
const condition = conditionById.get(ref);
|
|
457
|
+
const key = condition
|
|
458
|
+
? JSON.stringify({
|
|
459
|
+
expression: condition.data.expressionAnchor,
|
|
460
|
+
evidence: condition.support
|
|
461
|
+
.map((support) => support.evidenceRef)
|
|
462
|
+
.sort()
|
|
463
|
+
})
|
|
464
|
+
: ref;
|
|
465
|
+
if (!selectedByEvidence.has(key)) {
|
|
466
|
+
selectedByEvidence.set(key, ref);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
return [...selectedByEvidence.values()].sort((left, right) =>
|
|
470
|
+
left.localeCompare(right, "en")
|
|
471
|
+
);
|
|
472
|
+
};
|
|
473
|
+
const normalizeConditionAlternatives = (
|
|
474
|
+
alternatives: readonly ConditionAlternative[]
|
|
475
|
+
): ConditionAlternative[] => {
|
|
476
|
+
const byConditions = new Map<string, ConditionAlternative>();
|
|
477
|
+
for (const alternative of alternatives) {
|
|
478
|
+
const conditionRefs = uniqueConditionRefs(
|
|
479
|
+
alternative.conditionRefs
|
|
480
|
+
);
|
|
481
|
+
const key = conditionRefs.join("\u0000");
|
|
482
|
+
const existing = byConditions.get(key);
|
|
483
|
+
byConditions.set(key, {
|
|
484
|
+
conditionRefs,
|
|
485
|
+
sourceFactRefs: uniqueSorted([
|
|
486
|
+
...(existing?.sourceFactRefs ?? []),
|
|
487
|
+
...alternative.sourceFactRefs
|
|
488
|
+
])
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
return [...byConditions.values()].sort((left, right) =>
|
|
492
|
+
left.conditionRefs.join("\u0000").localeCompare(
|
|
493
|
+
right.conditionRefs.join("\u0000"),
|
|
494
|
+
"en"
|
|
495
|
+
)
|
|
496
|
+
);
|
|
497
|
+
};
|
|
498
|
+
const entryFacts = factsOfKind(source, "entry-point");
|
|
499
|
+
const propertyFacts = factsOfKind(source, "ui-property");
|
|
500
|
+
const containerFacts = factsOfKind(source, "container-binding");
|
|
501
|
+
const unresolved: UnresolvedItem[] = [...source.unresolved];
|
|
502
|
+
const sourceUnresolvedById = new Map(
|
|
503
|
+
source.unresolved.map((item) => [item.id, item])
|
|
504
|
+
);
|
|
505
|
+
const callbackTraversal = new CallbackFlowTraversal(
|
|
506
|
+
callbackFlowFacts,
|
|
507
|
+
{
|
|
508
|
+
maxCallDepth: options.maxCallDepth,
|
|
509
|
+
maxCallbackIterations: options.maxCallbackIterations,
|
|
510
|
+
conditionFacts
|
|
511
|
+
}
|
|
512
|
+
);
|
|
513
|
+
|
|
514
|
+
const areaByComponent = new Map<string, string>();
|
|
515
|
+
const areaById = new Map<string, Area>();
|
|
516
|
+
const componentById = new Map(
|
|
517
|
+
componentFacts.map((component) => [component.id, component])
|
|
518
|
+
);
|
|
519
|
+
const sourceFactById = new Map(
|
|
520
|
+
source.facts.map((fact) => [fact.id, fact])
|
|
521
|
+
);
|
|
522
|
+
const sourceEvidenceById = new Map(
|
|
523
|
+
source.evidence.map((item) => [item.id, item])
|
|
524
|
+
);
|
|
525
|
+
const evidenceRefsForNameSupport = (
|
|
526
|
+
supportRefs: readonly string[]
|
|
527
|
+
): string[] => uniqueSorted(supportRefs.flatMap((supportRef) => {
|
|
528
|
+
const fact = sourceFactById.get(supportRef);
|
|
529
|
+
if (fact) return fact.support.map((support) => support.evidenceRef);
|
|
530
|
+
return sourceEvidenceById.has(supportRef) ? [supportRef] : [];
|
|
531
|
+
}));
|
|
532
|
+
const explicitAppEntryComponentRefs = new Set<string>([
|
|
533
|
+
...componentFacts.flatMap((component) =>
|
|
534
|
+
component.support.some((support) =>
|
|
535
|
+
(
|
|
536
|
+
sourceEvidenceById.get(support.evidenceRef)?.sourceKind === "java" ||
|
|
537
|
+
sourceEvidenceById.get(support.evidenceRef)?.sourceKind === "kotlin"
|
|
538
|
+
)
|
|
539
|
+
)
|
|
540
|
+
? [component.id]
|
|
541
|
+
: []
|
|
542
|
+
),
|
|
543
|
+
...navigationFacts.flatMap((navigation) =>
|
|
544
|
+
navigation.data.targetKind === "component" &&
|
|
545
|
+
navigation.data.targetKey
|
|
546
|
+
? [navigation.data.targetKey]
|
|
547
|
+
: []
|
|
548
|
+
),
|
|
549
|
+
...effectFacts.flatMap((effect) =>
|
|
550
|
+
effect.data.effectKind === "navigate-area" && effect.data.targetKey
|
|
551
|
+
? [effect.data.targetKey]
|
|
552
|
+
: []
|
|
553
|
+
)
|
|
554
|
+
]);
|
|
555
|
+
const ownership = resolveAreaOwnership(
|
|
556
|
+
componentFacts,
|
|
557
|
+
containerFacts,
|
|
558
|
+
{ explicitAppEntryComponentRefs }
|
|
559
|
+
);
|
|
560
|
+
for (const group of ownership.groups) {
|
|
561
|
+
const fact = group.anchor;
|
|
562
|
+
const id = graphId(
|
|
563
|
+
"area",
|
|
564
|
+
source.caseId,
|
|
565
|
+
group.kind,
|
|
566
|
+
fact.id
|
|
567
|
+
);
|
|
568
|
+
group.componentRefs.forEach((componentRef) =>
|
|
569
|
+
areaByComponent.set(componentRef, id)
|
|
570
|
+
);
|
|
571
|
+
const componentRefs = new Set(group.componentRefs);
|
|
572
|
+
const titleFacts = propertyFacts
|
|
573
|
+
.filter((property) =>
|
|
574
|
+
componentRefs.has(property.data.ownerKey) &&
|
|
575
|
+
/^(title|label|name)$/iu.test(property.data.property) &&
|
|
576
|
+
typeof property.data.value === "string"
|
|
577
|
+
)
|
|
578
|
+
.sort((left, right) =>
|
|
579
|
+
Number(right.data.ownerKey === fact.id) -
|
|
580
|
+
Number(left.data.ownerKey === fact.id) ||
|
|
581
|
+
left.id.localeCompare(right.id, "en")
|
|
582
|
+
);
|
|
583
|
+
const nameDecision = resolveNameCandidates([
|
|
584
|
+
...titleFacts.map((title) => literalNameCandidate(
|
|
585
|
+
"visible-title",
|
|
586
|
+
typeof title.data.value === "string" ? title.data.value : undefined,
|
|
587
|
+
[title.id],
|
|
588
|
+
title.confidence,
|
|
589
|
+
{
|
|
590
|
+
frameworkGeneric: title.support.some((support) =>
|
|
591
|
+
support.role === "resolved Compose surface API name"
|
|
592
|
+
)
|
|
593
|
+
}
|
|
594
|
+
)),
|
|
595
|
+
codeNameCandidate(
|
|
596
|
+
"component-identifier",
|
|
597
|
+
fact.data.qualifiedName,
|
|
598
|
+
[fact.id],
|
|
599
|
+
componentIdentifierName
|
|
600
|
+
)
|
|
601
|
+
]);
|
|
602
|
+
let areaName: SupportedValue<string>;
|
|
603
|
+
const areaUnresolvedRefs = uniqueSorted(
|
|
604
|
+
group.componentRefs.flatMap((componentRef) =>
|
|
605
|
+
componentById.get(componentRef)?.unresolvedRefs ?? []
|
|
606
|
+
)
|
|
607
|
+
);
|
|
608
|
+
if (
|
|
609
|
+
nameDecision.value !== undefined &&
|
|
610
|
+
nameDecision.confidence !== undefined
|
|
611
|
+
) {
|
|
612
|
+
areaName = resolved(
|
|
613
|
+
nameDecision.value,
|
|
614
|
+
nameDecision.supportRefs,
|
|
615
|
+
nameDecision.confidence
|
|
616
|
+
);
|
|
617
|
+
} else {
|
|
618
|
+
const unresolvedId = graphId(
|
|
619
|
+
"unresolved",
|
|
620
|
+
source.caseId,
|
|
621
|
+
"area-name",
|
|
622
|
+
fact.id
|
|
623
|
+
);
|
|
624
|
+
unresolved.push({
|
|
625
|
+
id: unresolvedId,
|
|
626
|
+
ownerRef: id,
|
|
627
|
+
fieldPath: "name",
|
|
628
|
+
reasonCode: "INTRINSIC_AREA_NAME_UNKNOWN",
|
|
629
|
+
message:
|
|
630
|
+
"区域没有可用标题;类名、路由和 Surface 身份候选也均为 raw/hash、抽象 Base 或框架泛称。",
|
|
631
|
+
evidenceRefs: uniqueSorted([
|
|
632
|
+
...fact.support.map((support) => support.evidenceRef),
|
|
633
|
+
...titleFacts.flatMap((title) =>
|
|
634
|
+
title.support.map((support) => support.evidenceRef)
|
|
635
|
+
)
|
|
636
|
+
]),
|
|
637
|
+
candidates: nameDecision.attempts.flatMap((attempt) =>
|
|
638
|
+
attempt.outcome === "rejected" && attempt.rawValue !== undefined
|
|
639
|
+
? [{
|
|
640
|
+
value: attempt.rawValue,
|
|
641
|
+
supportRefs: evidenceRefsForNameSupport(attempt.supportRefs),
|
|
642
|
+
...(attempt.reason ? { note: attempt.reason } : {})
|
|
643
|
+
}]
|
|
644
|
+
: []
|
|
645
|
+
),
|
|
646
|
+
impact: ["req-area-name"],
|
|
647
|
+
originRef: fact.id
|
|
648
|
+
});
|
|
649
|
+
areaUnresolvedRefs.push(unresolvedId);
|
|
650
|
+
areaName = { status: "unresolved", unresolvedRef: unresolvedId };
|
|
651
|
+
}
|
|
652
|
+
areaById.set(id, {
|
|
653
|
+
id,
|
|
654
|
+
identityAnchors: uniqueSorted(
|
|
655
|
+
group.componentRefs.flatMap((componentRef) => {
|
|
656
|
+
const component = componentById.get(componentRef);
|
|
657
|
+
return component
|
|
658
|
+
? [component.id, component.data.qualifiedName]
|
|
659
|
+
: [];
|
|
660
|
+
})
|
|
661
|
+
),
|
|
662
|
+
kind: group.kind,
|
|
663
|
+
name: areaName,
|
|
664
|
+
descriptionFacts: stableDescriptionFacts(
|
|
665
|
+
source.caseId,
|
|
666
|
+
id,
|
|
667
|
+
componentRefs,
|
|
668
|
+
areaName,
|
|
669
|
+
uiFacts,
|
|
670
|
+
propertyFacts,
|
|
671
|
+
boundUiFactRefs
|
|
672
|
+
),
|
|
673
|
+
controlRefs: [],
|
|
674
|
+
conditions: conditionFacts
|
|
675
|
+
.filter((condition) =>
|
|
676
|
+
componentRefs.has(condition.data.ownerKey)
|
|
677
|
+
)
|
|
678
|
+
.map((condition) => condition.id)
|
|
679
|
+
.sort(),
|
|
680
|
+
sourceFactRefs: uniqueSorted([
|
|
681
|
+
...group.componentRefs,
|
|
682
|
+
...group.containerBindingRefs
|
|
683
|
+
]),
|
|
684
|
+
unresolvedRefs: uniqueSorted(areaUnresolvedRefs)
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const controls: Control[] = [];
|
|
689
|
+
const controlByUi = new Map<string, string>();
|
|
690
|
+
for (const fact of uiFacts) {
|
|
691
|
+
if (
|
|
692
|
+
!fact.data.actionable &&
|
|
693
|
+
!boundUiFactRefs.has(fact.id)
|
|
694
|
+
) continue;
|
|
695
|
+
const areaRef = areaByComponent.get(fact.data.ownerKey);
|
|
696
|
+
if (!areaRef) continue;
|
|
697
|
+
const id = graphId("control", source.caseId, fact.data.elementType, fact.id);
|
|
698
|
+
controlByUi.set(fact.id, id);
|
|
699
|
+
const ownerArea = areaById.get(areaRef);
|
|
700
|
+
const areaName = ownerArea?.name.status === "resolved"
|
|
701
|
+
? ownerArea.name.value
|
|
702
|
+
: undefined;
|
|
703
|
+
const areaNameSupport = ownerArea?.name.status === "resolved"
|
|
704
|
+
? ownerArea.name.supportRefs
|
|
705
|
+
: [];
|
|
706
|
+
const repeatedItemName =
|
|
707
|
+
(
|
|
708
|
+
fact.data.elementType === "list-item" ||
|
|
709
|
+
fact.data.elementType === "repeated-row"
|
|
710
|
+
) &&
|
|
711
|
+
fact.data.dynamicIdentity
|
|
712
|
+
? repeatedControlName(areaName)
|
|
713
|
+
: undefined;
|
|
714
|
+
const nameDecision = resolveNameCandidates(controlNameCandidates(
|
|
715
|
+
fact.data,
|
|
716
|
+
fact.id,
|
|
717
|
+
fact.confidence,
|
|
718
|
+
repeatedItemName,
|
|
719
|
+
areaNameSupport
|
|
720
|
+
));
|
|
721
|
+
const sourceNameUnresolvedItems = sourceControlNameUnresolvedItems(
|
|
722
|
+
fact,
|
|
723
|
+
sourceUnresolvedById
|
|
724
|
+
);
|
|
725
|
+
const resolvedSourceNameUnresolvedRefs = new Set(
|
|
726
|
+
nameDecision.value !== undefined
|
|
727
|
+
? sourceNameUnresolvedItems.map((item) => item.id)
|
|
728
|
+
: []
|
|
729
|
+
);
|
|
730
|
+
const unresolvedRefs = (fact.unresolvedRefs ?? []).filter(
|
|
731
|
+
(ref) => !resolvedSourceNameUnresolvedRefs.has(ref)
|
|
732
|
+
);
|
|
733
|
+
let supportedName: SupportedValue<string>;
|
|
734
|
+
if (
|
|
735
|
+
nameDecision.value !== undefined &&
|
|
736
|
+
nameDecision.confidence !== undefined
|
|
737
|
+
) {
|
|
738
|
+
for (let index = unresolved.length - 1; index >= 0; index -= 1) {
|
|
739
|
+
if (resolvedSourceNameUnresolvedRefs.has(unresolved[index].id)) {
|
|
740
|
+
unresolved.splice(index, 1);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
supportedName = resolved(
|
|
744
|
+
nameDecision.value,
|
|
745
|
+
nameDecision.supportRefs,
|
|
746
|
+
nameDecision.confidence
|
|
747
|
+
);
|
|
748
|
+
} else {
|
|
749
|
+
const sourceUnresolvedRef = sourceControlNameUnresolvedRef(
|
|
750
|
+
fact,
|
|
751
|
+
sourceUnresolvedById
|
|
752
|
+
);
|
|
753
|
+
const unresolvedId = sourceUnresolvedRef ?? graphId(
|
|
754
|
+
"unresolved",
|
|
755
|
+
source.caseId,
|
|
756
|
+
"control-name",
|
|
757
|
+
fact.id
|
|
758
|
+
);
|
|
759
|
+
if (!sourceUnresolvedRef) {
|
|
760
|
+
unresolved.push({
|
|
761
|
+
id: unresolvedId,
|
|
762
|
+
ownerRef: id,
|
|
763
|
+
fieldPath: "name",
|
|
764
|
+
reasonCode: "INTRINSIC_CONTROL_NAME_UNKNOWN",
|
|
765
|
+
message: "控件没有可见文字、无障碍标签或可证明的图标语义。",
|
|
766
|
+
evidenceRefs: fact.support.map((item) => item.evidenceRef),
|
|
767
|
+
candidates: nameDecision.attempts.flatMap((attempt) =>
|
|
768
|
+
attempt.outcome === "rejected" && attempt.rawValue !== undefined
|
|
769
|
+
? [{
|
|
770
|
+
value: attempt.rawValue,
|
|
771
|
+
supportRefs: evidenceRefsForNameSupport(attempt.supportRefs),
|
|
772
|
+
...(attempt.reason ? { note: attempt.reason } : {})
|
|
773
|
+
}]
|
|
774
|
+
: []
|
|
775
|
+
),
|
|
776
|
+
impact: ["req-feature-name"],
|
|
777
|
+
originRef: fact.id
|
|
778
|
+
});
|
|
779
|
+
unresolvedRefs.push(unresolvedId);
|
|
780
|
+
}
|
|
781
|
+
supportedName = { status: "unresolved", unresolvedRef: unresolvedId };
|
|
782
|
+
}
|
|
783
|
+
const ownedControlConditions = conditionFacts.filter(
|
|
784
|
+
(condition) => condition.data.ownerKey === fact.id
|
|
785
|
+
);
|
|
786
|
+
const visibilityConditions = ownedControlConditions
|
|
787
|
+
.filter((condition) => condition.data.conditionRole === "visibility")
|
|
788
|
+
.map((condition) => condition.id)
|
|
789
|
+
.sort((left, right) => left.localeCompare(right, "en"));
|
|
790
|
+
const enabledConditions = ownedControlConditions
|
|
791
|
+
.filter((condition) => condition.data.conditionRole !== "visibility")
|
|
792
|
+
.map((condition) => condition.id)
|
|
793
|
+
.sort((left, right) => left.localeCompare(right, "en"));
|
|
794
|
+
const enabled = staticEnabledFor(fact.id, propertyFacts);
|
|
795
|
+
const control: Control = {
|
|
796
|
+
id,
|
|
797
|
+
areaRef,
|
|
798
|
+
kind: fact.data.elementType,
|
|
799
|
+
name: supportedName,
|
|
800
|
+
...(enabled ? { enabled } : {}),
|
|
801
|
+
actionRefs: [],
|
|
802
|
+
visibilityConditions,
|
|
803
|
+
enabledConditions,
|
|
804
|
+
sourceFactRefs: uniqueSorted([
|
|
805
|
+
fact.id,
|
|
806
|
+
...visibilityConditions,
|
|
807
|
+
...enabledConditions,
|
|
808
|
+
...(enabled?.status === "resolved" ? enabled.supportRefs : [])
|
|
809
|
+
]),
|
|
810
|
+
unresolvedRefs: [...new Set(unresolvedRefs)].sort()
|
|
811
|
+
};
|
|
812
|
+
controls.push(control);
|
|
813
|
+
const area = areaById.get(areaRef);
|
|
814
|
+
if (area) {
|
|
815
|
+
areaById.set(areaRef, {
|
|
816
|
+
...area,
|
|
817
|
+
controlRefs: [...area.controlRefs, id].sort()
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
const actions: Action[] = [];
|
|
823
|
+
const effects: Effect[] = [];
|
|
824
|
+
const edges: Edge[] = [];
|
|
825
|
+
const externalEndpoints: ExternalEndpoint[] = [];
|
|
826
|
+
const actionByBinding = new Map<string, string>();
|
|
827
|
+
const effectGraphByFact = new Map<string, string>();
|
|
828
|
+
const navigationByEffect = new Map(
|
|
829
|
+
navigationFacts.map((fact) => [fact.data.effectKey, fact])
|
|
830
|
+
);
|
|
831
|
+
const exactTargetEffectSemanticKey = (
|
|
832
|
+
effect: SourceFact<"behavior-effect">
|
|
833
|
+
): string | undefined => {
|
|
834
|
+
if (!effect.data.targetKey) return undefined;
|
|
835
|
+
const effectData = Object.fromEntries(
|
|
836
|
+
Object.entries(effect.data).filter(([key]) => key !== "conditionKeys")
|
|
837
|
+
);
|
|
838
|
+
const navigation = navigationByEffect.get(effect.id);
|
|
839
|
+
const navigationData = navigation
|
|
840
|
+
? Object.fromEntries(
|
|
841
|
+
Object.entries(navigation.data).filter(([key]) => key !== "effectKey")
|
|
842
|
+
)
|
|
843
|
+
: undefined;
|
|
844
|
+
return canonicalSemanticValue({
|
|
845
|
+
effectData,
|
|
846
|
+
confidence: effect.confidence,
|
|
847
|
+
unresolvedRefs: uniqueSorted(effect.unresolvedRefs ?? []),
|
|
848
|
+
...(navigation
|
|
849
|
+
? {
|
|
850
|
+
navigation: {
|
|
851
|
+
data: navigationData,
|
|
852
|
+
confidence: navigation.confidence,
|
|
853
|
+
unresolvedRefs: uniqueSorted(navigation.unresolvedRefs ?? [])
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
: {})
|
|
857
|
+
});
|
|
858
|
+
};
|
|
859
|
+
const hasResolvedAreaTarget = (
|
|
860
|
+
effect: SourceFact<"behavior-effect">
|
|
861
|
+
): boolean => {
|
|
862
|
+
if (
|
|
863
|
+
effect.data.targetKey &&
|
|
864
|
+
areaByComponent.has(effect.data.targetKey)
|
|
865
|
+
) return true;
|
|
866
|
+
const navigation = navigationByEffect.get(effect.id);
|
|
867
|
+
if (
|
|
868
|
+
navigation?.data.targetKind === "component" &&
|
|
869
|
+
navigation.data.targetKey &&
|
|
870
|
+
areaByComponent.has(navigation.data.targetKey)
|
|
871
|
+
) return true;
|
|
872
|
+
return Boolean(
|
|
873
|
+
navigation?.data.targetKind === "route" &&
|
|
874
|
+
navigation.data.uri &&
|
|
875
|
+
resolveComposeRouteArea(
|
|
876
|
+
navigation.data.uri,
|
|
877
|
+
componentFacts,
|
|
878
|
+
areaByComponent
|
|
879
|
+
).areaRef
|
|
880
|
+
);
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
const addUnknownEffectForAction = (
|
|
884
|
+
action: Action,
|
|
885
|
+
originRef: string,
|
|
886
|
+
sourceFactRefs: readonly string[],
|
|
887
|
+
evidenceRefs: readonly string[],
|
|
888
|
+
message: string
|
|
889
|
+
): { readonly effectId: string; readonly unresolvedId: string } => {
|
|
890
|
+
const effectId = graphId(
|
|
891
|
+
"effect",
|
|
892
|
+
source.caseId,
|
|
893
|
+
"unknown",
|
|
894
|
+
action.id
|
|
895
|
+
);
|
|
896
|
+
const unresolvedId = graphId(
|
|
897
|
+
"unresolved",
|
|
898
|
+
source.caseId,
|
|
899
|
+
"control-action",
|
|
900
|
+
originRef
|
|
901
|
+
);
|
|
902
|
+
unresolved.push({
|
|
903
|
+
id: unresolvedId,
|
|
904
|
+
ownerRef: action.id,
|
|
905
|
+
fieldPath: "effectRefs",
|
|
906
|
+
reasonCode: "INTRINSIC_CONTROL_ACTION_UNKNOWN",
|
|
907
|
+
message,
|
|
908
|
+
evidenceRefs: uniqueSorted(evidenceRefs),
|
|
909
|
+
candidates: [],
|
|
910
|
+
impact: ["req-feature-effect"],
|
|
911
|
+
originRef
|
|
912
|
+
});
|
|
913
|
+
effects.push({
|
|
914
|
+
id: effectId,
|
|
915
|
+
actionRef: action.id,
|
|
916
|
+
kind: "unknown",
|
|
917
|
+
description: { status: "unresolved", unresolvedRef: unresolvedId },
|
|
918
|
+
sourceFactRefs: uniqueSorted(sourceFactRefs),
|
|
919
|
+
unresolvedRefs: [unresolvedId]
|
|
920
|
+
});
|
|
921
|
+
return { effectId, unresolvedId };
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
const addEffectForAction = (
|
|
925
|
+
action: Action,
|
|
926
|
+
sourceEffect: SourceFact<"behavior-effect">,
|
|
927
|
+
alternatives: readonly ConditionAlternative[],
|
|
928
|
+
equivalentSourceEffects: readonly SourceFact<"behavior-effect">[] = [
|
|
929
|
+
sourceEffect
|
|
930
|
+
]
|
|
931
|
+
): string => {
|
|
932
|
+
const equivalentEffectRefs = uniqueSorted(
|
|
933
|
+
equivalentSourceEffects.map((effect) => effect.id)
|
|
934
|
+
);
|
|
935
|
+
const equivalentNavigations = equivalentSourceEffects.flatMap((effect) => {
|
|
936
|
+
const candidate = navigationByEffect.get(effect.id);
|
|
937
|
+
return candidate ? [candidate] : [];
|
|
938
|
+
});
|
|
939
|
+
const equivalentNavigationRefs = uniqueSorted(
|
|
940
|
+
equivalentNavigations.map((candidate) => candidate.id)
|
|
941
|
+
);
|
|
942
|
+
const normalizedAlternatives = normalizeConditionAlternatives(
|
|
943
|
+
alternatives
|
|
944
|
+
);
|
|
945
|
+
const flowFactRefs = uniqueSorted(
|
|
946
|
+
normalizedAlternatives.flatMap((alternative) =>
|
|
947
|
+
alternative.sourceFactRefs
|
|
948
|
+
)
|
|
949
|
+
);
|
|
950
|
+
const conditionRefs = uniqueConditionRefs(
|
|
951
|
+
normalizedAlternatives.flatMap((alternative) =>
|
|
952
|
+
alternative.conditionRefs
|
|
953
|
+
)
|
|
954
|
+
);
|
|
955
|
+
const id = graphId(
|
|
956
|
+
"effect",
|
|
957
|
+
source.caseId,
|
|
958
|
+
sourceEffect.data.effectKind,
|
|
959
|
+
`${action.id}:${sourceEffect.id}`
|
|
960
|
+
);
|
|
961
|
+
for (const equivalent of equivalentSourceEffects) {
|
|
962
|
+
effectGraphByFact.set(equivalent.id, id);
|
|
963
|
+
}
|
|
964
|
+
const navigation = navigationByEffect.get(sourceEffect.id);
|
|
965
|
+
const routeResolution =
|
|
966
|
+
!sourceEffect.data.targetKey &&
|
|
967
|
+
navigation?.data.targetKind === "route" &&
|
|
968
|
+
navigation.data.uri
|
|
969
|
+
? resolveComposeRouteArea(
|
|
970
|
+
navigation.data.uri,
|
|
971
|
+
componentFacts,
|
|
972
|
+
areaByComponent
|
|
973
|
+
)
|
|
974
|
+
: undefined;
|
|
975
|
+
const targetArea = sourceEffect.data.targetKey
|
|
976
|
+
? areaByComponent.get(sourceEffect.data.targetKey)
|
|
977
|
+
: routeResolution?.areaRef;
|
|
978
|
+
const targetComponent = sourceEffect.data.targetKey
|
|
979
|
+
? componentFacts.find((fact) => fact.id === sourceEffect.data.targetKey)
|
|
980
|
+
: undefined;
|
|
981
|
+
const targetComponentName = targetComponent
|
|
982
|
+
? resolveNameCandidates([codeNameCandidate(
|
|
983
|
+
"component-identifier",
|
|
984
|
+
targetComponent.data.qualifiedName,
|
|
985
|
+
[targetComponent.id],
|
|
986
|
+
componentIdentifierName
|
|
987
|
+
)])
|
|
988
|
+
: undefined;
|
|
989
|
+
const externalTargetName = androidExternalTargetName(
|
|
990
|
+
navigation?.data.intentAction
|
|
991
|
+
);
|
|
992
|
+
const targetName = targetArea
|
|
993
|
+
? areaById.get(targetArea)?.name
|
|
994
|
+
: targetComponentName?.value !== undefined &&
|
|
995
|
+
targetComponentName.confidence !== undefined
|
|
996
|
+
? resolved(
|
|
997
|
+
targetComponentName.value,
|
|
998
|
+
targetComponentName.supportRefs,
|
|
999
|
+
targetComponentName.confidence
|
|
1000
|
+
)
|
|
1001
|
+
: navigation?.data.presentation === "chooser"
|
|
1002
|
+
? resolved(
|
|
1003
|
+
"Android 系统选择器",
|
|
1004
|
+
[navigation.id],
|
|
1005
|
+
navigation.confidence
|
|
1006
|
+
)
|
|
1007
|
+
: externalTargetName && navigation
|
|
1008
|
+
? resolved(
|
|
1009
|
+
externalTargetName,
|
|
1010
|
+
[navigation.id],
|
|
1011
|
+
navigation.confidence
|
|
1012
|
+
)
|
|
1013
|
+
: undefined;
|
|
1014
|
+
const inheritedNavigationUnresolvedRefs = uniqueSorted([
|
|
1015
|
+
...equivalentSourceEffects.flatMap((effect) =>
|
|
1016
|
+
effect.unresolvedRefs ?? []
|
|
1017
|
+
),
|
|
1018
|
+
...equivalentNavigations.flatMap((candidate) =>
|
|
1019
|
+
candidate.unresolvedRefs ?? []
|
|
1020
|
+
)
|
|
1021
|
+
]);
|
|
1022
|
+
const effectUnresolvedRefs = [...inheritedNavigationUnresolvedRefs];
|
|
1023
|
+
const unknownEffectUnresolvedRef = sourceEffect.data.effectKind === "unknown"
|
|
1024
|
+
? graphId(
|
|
1025
|
+
"unresolved",
|
|
1026
|
+
source.caseId,
|
|
1027
|
+
"effect-kind",
|
|
1028
|
+
id
|
|
1029
|
+
)
|
|
1030
|
+
: undefined;
|
|
1031
|
+
if (
|
|
1032
|
+
unknownEffectUnresolvedRef &&
|
|
1033
|
+
!unresolved.some((item) => item.id === unknownEffectUnresolvedRef)
|
|
1034
|
+
) {
|
|
1035
|
+
unresolved.push({
|
|
1036
|
+
id: unknownEffectUnresolvedRef,
|
|
1037
|
+
ownerRef: id,
|
|
1038
|
+
fieldPath: "description",
|
|
1039
|
+
reasonCode: "INTRINSIC_EFFECT_KIND_UNKNOWN",
|
|
1040
|
+
message: "已识别到交互效果调用,但静态源码不能确定其用户可感知结果。",
|
|
1041
|
+
evidenceRefs: uniqueSorted(equivalentSourceEffects.flatMap((effect) =>
|
|
1042
|
+
effect.support.map((item) => item.evidenceRef)
|
|
1043
|
+
)),
|
|
1044
|
+
candidates: [],
|
|
1045
|
+
impact: ["req-feature-effect"],
|
|
1046
|
+
originRef: sourceEffect.id
|
|
1047
|
+
});
|
|
1048
|
+
effectUnresolvedRefs.push(unknownEffectUnresolvedRef);
|
|
1049
|
+
}
|
|
1050
|
+
const hasResolvedValue = Object.prototype.hasOwnProperty.call(
|
|
1051
|
+
sourceEffect.data,
|
|
1052
|
+
"value"
|
|
1053
|
+
);
|
|
1054
|
+
const hasInheritedFeedbackValueUnknown =
|
|
1055
|
+
inheritedNavigationUnresolvedRefs.some((unresolvedRef) => {
|
|
1056
|
+
const item = sourceUnresolvedById.get(unresolvedRef);
|
|
1057
|
+
return item !== undefined &&
|
|
1058
|
+
(
|
|
1059
|
+
/feedback|snackbar|toast/iu.test(item.reasonCode) ||
|
|
1060
|
+
/(?:value|text|message)$/iu.test(item.fieldPath)
|
|
1061
|
+
);
|
|
1062
|
+
});
|
|
1063
|
+
if (
|
|
1064
|
+
sourceEffect.data.effectKind === "show-feedback" &&
|
|
1065
|
+
!hasResolvedValue &&
|
|
1066
|
+
!hasInheritedFeedbackValueUnknown
|
|
1067
|
+
) {
|
|
1068
|
+
const unresolvedId = graphId(
|
|
1069
|
+
"unresolved",
|
|
1070
|
+
source.caseId,
|
|
1071
|
+
"feedback-value",
|
|
1072
|
+
sourceEffect.id
|
|
1073
|
+
);
|
|
1074
|
+
if (!unresolved.some((item) => item.id === unresolvedId)) {
|
|
1075
|
+
unresolved.push({
|
|
1076
|
+
id: unresolvedId,
|
|
1077
|
+
ownerRef: id,
|
|
1078
|
+
fieldPath: "value",
|
|
1079
|
+
reasonCode: "INTRINSIC_FEEDBACK_VALUE_UNKNOWN",
|
|
1080
|
+
message: "已确认会显示短暂提示,但静态源码不能确定提示内容。",
|
|
1081
|
+
evidenceRefs: sourceEffect.support.map(
|
|
1082
|
+
(item) => item.evidenceRef
|
|
1083
|
+
),
|
|
1084
|
+
candidates: [],
|
|
1085
|
+
impact: ["req-feature-effect"],
|
|
1086
|
+
originRef: sourceEffect.id
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
effectUnresolvedRefs.push(unresolvedId);
|
|
1090
|
+
}
|
|
1091
|
+
const supportRefs = uniqueSorted([
|
|
1092
|
+
...equivalentEffectRefs,
|
|
1093
|
+
...flowFactRefs,
|
|
1094
|
+
...equivalentNavigationRefs
|
|
1095
|
+
]);
|
|
1096
|
+
effects.push({
|
|
1097
|
+
id,
|
|
1098
|
+
actionRef: action.id,
|
|
1099
|
+
kind: sourceEffect.data.effectKind,
|
|
1100
|
+
description: unknownEffectUnresolvedRef
|
|
1101
|
+
? { status: "unresolved", unresolvedRef: unknownEffectUnresolvedRef }
|
|
1102
|
+
: resolved(
|
|
1103
|
+
effectText(
|
|
1104
|
+
sourceEffect.data,
|
|
1105
|
+
targetName?.status === "resolved" ? targetName.value : undefined
|
|
1106
|
+
),
|
|
1107
|
+
uniqueSorted([
|
|
1108
|
+
...equivalentEffectRefs,
|
|
1109
|
+
...equivalentNavigationRefs
|
|
1110
|
+
]),
|
|
1111
|
+
sourceEffect.confidence
|
|
1112
|
+
),
|
|
1113
|
+
...(normalizedAlternatives.some(
|
|
1114
|
+
(alternative) => alternative.conditionRefs.length > 0
|
|
1115
|
+
)
|
|
1116
|
+
? { conditionAlternatives: normalizedAlternatives }
|
|
1117
|
+
: {}),
|
|
1118
|
+
...(sourceEffect.data.closePolicy
|
|
1119
|
+
? { closePolicy: sourceEffect.data.closePolicy }
|
|
1120
|
+
: {}),
|
|
1121
|
+
...(sourceEffect.data.transitionMode
|
|
1122
|
+
? { transitionMode: sourceEffect.data.transitionMode }
|
|
1123
|
+
: {}),
|
|
1124
|
+
...(sourceEffect.data.stateKey
|
|
1125
|
+
? {
|
|
1126
|
+
stateKey: resolved(
|
|
1127
|
+
stateKeyDisplayName(sourceEffect.data.stateKey),
|
|
1128
|
+
equivalentEffectRefs,
|
|
1129
|
+
sourceEffect.confidence
|
|
1130
|
+
)
|
|
1131
|
+
}
|
|
1132
|
+
: {}),
|
|
1133
|
+
...(hasResolvedValue
|
|
1134
|
+
? {
|
|
1135
|
+
value: resolved(
|
|
1136
|
+
sourceEffect.data.value ?? null,
|
|
1137
|
+
equivalentEffectRefs,
|
|
1138
|
+
sourceEffect.confidence
|
|
1139
|
+
)
|
|
1140
|
+
}
|
|
1141
|
+
: {}),
|
|
1142
|
+
sourceFactRefs: supportRefs,
|
|
1143
|
+
unresolvedRefs: uniqueSorted(effectUnresolvedRefs)
|
|
1144
|
+
});
|
|
1145
|
+
|
|
1146
|
+
if (
|
|
1147
|
+
sourceEffect.data.effectKind !== "navigate-area" &&
|
|
1148
|
+
sourceEffect.data.effectKind !== "show-surface" &&
|
|
1149
|
+
sourceEffect.data.effectKind !== "open-external" &&
|
|
1150
|
+
navigation?.data.targetKind !== "external"
|
|
1151
|
+
) {
|
|
1152
|
+
return id;
|
|
1153
|
+
}
|
|
1154
|
+
let target: Edge["target"];
|
|
1155
|
+
if (targetArea) {
|
|
1156
|
+
target = { kind: "area", ref: targetArea };
|
|
1157
|
+
} else if (
|
|
1158
|
+
sourceEffect.data.effectKind === "open-external" ||
|
|
1159
|
+
navigation?.data.targetKind === "external"
|
|
1160
|
+
) {
|
|
1161
|
+
const endpointSemanticKey = [
|
|
1162
|
+
navigation?.data.presentation ?? "direct",
|
|
1163
|
+
navigation?.data.intentAction ?? "external",
|
|
1164
|
+
navigation?.data.mimeType ?? "",
|
|
1165
|
+
navigation?.data.uri ?? targetComponent?.data.qualifiedName ?? ""
|
|
1166
|
+
].join("\u0000");
|
|
1167
|
+
const endpointId = graphId(
|
|
1168
|
+
"external",
|
|
1169
|
+
source.caseId,
|
|
1170
|
+
"endpoint",
|
|
1171
|
+
endpointSemanticKey
|
|
1172
|
+
);
|
|
1173
|
+
const existingEndpoint = externalEndpoints.findIndex(
|
|
1174
|
+
(item) => item.id === endpointId
|
|
1175
|
+
);
|
|
1176
|
+
if (existingEndpoint < 0) {
|
|
1177
|
+
externalEndpoints.push({
|
|
1178
|
+
id: endpointId,
|
|
1179
|
+
kind: navigation?.data.presentation === "chooser"
|
|
1180
|
+
? "android-intent-chooser"
|
|
1181
|
+
: navigation?.data.intentAction ?? "external",
|
|
1182
|
+
name: targetName ?? resolved(
|
|
1183
|
+
navigation?.data.uri ?? "App 外目标",
|
|
1184
|
+
[navigation?.id ?? sourceEffect.id],
|
|
1185
|
+
"medium"
|
|
1186
|
+
),
|
|
1187
|
+
...(navigation?.data.presentation
|
|
1188
|
+
? { presentation: navigation.data.presentation }
|
|
1189
|
+
: {}),
|
|
1190
|
+
...(navigation?.data.intentAction
|
|
1191
|
+
? {
|
|
1192
|
+
intentAction: resolved(
|
|
1193
|
+
navigation.data.intentAction,
|
|
1194
|
+
[navigation.id],
|
|
1195
|
+
navigation.confidence
|
|
1196
|
+
)
|
|
1197
|
+
}
|
|
1198
|
+
: {}),
|
|
1199
|
+
...(navigation?.data.mimeType
|
|
1200
|
+
? {
|
|
1201
|
+
mimeType: resolved(
|
|
1202
|
+
navigation.data.mimeType,
|
|
1203
|
+
[navigation.id],
|
|
1204
|
+
navigation.confidence
|
|
1205
|
+
)
|
|
1206
|
+
}
|
|
1207
|
+
: {}),
|
|
1208
|
+
...(navigation?.data.uri
|
|
1209
|
+
? {
|
|
1210
|
+
uri: resolved(
|
|
1211
|
+
navigation.data.uri,
|
|
1212
|
+
[navigation.id],
|
|
1213
|
+
navigation.confidence
|
|
1214
|
+
)
|
|
1215
|
+
}
|
|
1216
|
+
: {}),
|
|
1217
|
+
sourceFactRefs: [
|
|
1218
|
+
...equivalentEffectRefs,
|
|
1219
|
+
...equivalentNavigationRefs
|
|
1220
|
+
].sort(),
|
|
1221
|
+
unresolvedRefs: []
|
|
1222
|
+
});
|
|
1223
|
+
} else {
|
|
1224
|
+
externalEndpoints[existingEndpoint] = {
|
|
1225
|
+
...externalEndpoints[existingEndpoint],
|
|
1226
|
+
sourceFactRefs: uniqueSorted([
|
|
1227
|
+
...externalEndpoints[existingEndpoint].sourceFactRefs,
|
|
1228
|
+
...equivalentEffectRefs,
|
|
1229
|
+
...equivalentNavigationRefs
|
|
1230
|
+
])
|
|
1231
|
+
};
|
|
1232
|
+
}
|
|
1233
|
+
target = { kind: "external", ref: endpointId };
|
|
1234
|
+
} else {
|
|
1235
|
+
const inheritedUnresolvedId =
|
|
1236
|
+
inheritedNavigationUnresolvedRefs.length === 1
|
|
1237
|
+
? inheritedNavigationUnresolvedRefs[0]
|
|
1238
|
+
: undefined;
|
|
1239
|
+
const unresolvedId = inheritedUnresolvedId ?? graphId(
|
|
1240
|
+
"unresolved",
|
|
1241
|
+
source.caseId,
|
|
1242
|
+
"edge-target",
|
|
1243
|
+
sourceEffect.id
|
|
1244
|
+
);
|
|
1245
|
+
if (!inheritedUnresolvedId) {
|
|
1246
|
+
unresolved.push({
|
|
1247
|
+
id: unresolvedId,
|
|
1248
|
+
ownerRef: id,
|
|
1249
|
+
fieldPath: "target",
|
|
1250
|
+
reasonCode: "INTRINSIC_NAVIGATION_TARGET_UNKNOWN",
|
|
1251
|
+
message: "静态源码不能确定该导航效果的目标。",
|
|
1252
|
+
evidenceRefs: sourceEffect.support.map((item) => item.evidenceRef),
|
|
1253
|
+
candidates: (routeResolution?.candidateAreaRefs ?? [])
|
|
1254
|
+
.map((value) => ({
|
|
1255
|
+
value,
|
|
1256
|
+
supportRefs: navigation
|
|
1257
|
+
? navigation.support.map((item) => item.evidenceRef)
|
|
1258
|
+
: []
|
|
1259
|
+
})),
|
|
1260
|
+
impact: ["area-path"],
|
|
1261
|
+
originRef: sourceEffect.id
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
target = { status: "unresolved", unresolvedRef: unresolvedId };
|
|
1265
|
+
}
|
|
1266
|
+
const control = controls.find((item) => item.id === action.controlRef);
|
|
1267
|
+
if (control) {
|
|
1268
|
+
edges.push({
|
|
1269
|
+
id: graphId(
|
|
1270
|
+
"edge",
|
|
1271
|
+
source.caseId,
|
|
1272
|
+
sourceEffect.data.effectKind,
|
|
1273
|
+
`${control.areaRef}:${id}`
|
|
1274
|
+
),
|
|
1275
|
+
sourceAreaRef: control.areaRef,
|
|
1276
|
+
controlRef: control.id,
|
|
1277
|
+
actionRef: action.id,
|
|
1278
|
+
target,
|
|
1279
|
+
conditions: uniqueConditionRefs([
|
|
1280
|
+
...conditionRefs,
|
|
1281
|
+
...(areaById.get(control.areaRef)?.conditions ?? [])
|
|
1282
|
+
]),
|
|
1283
|
+
...(normalizedAlternatives.some(
|
|
1284
|
+
(alternative) => alternative.conditionRefs.length > 0
|
|
1285
|
+
)
|
|
1286
|
+
? { conditionAlternatives: normalizedAlternatives }
|
|
1287
|
+
: {}),
|
|
1288
|
+
preconditions: uniqueConditionRefs([
|
|
1289
|
+
...control.visibilityConditions.filter((conditionRef) =>
|
|
1290
|
+
conditionById.get(conditionRef)?.data.pathRequirement ===
|
|
1291
|
+
"runtime-availability"
|
|
1292
|
+
),
|
|
1293
|
+
...control.enabledConditions
|
|
1294
|
+
]),
|
|
1295
|
+
sourceFactRefs: uniqueSorted([
|
|
1296
|
+
...equivalentEffectRefs,
|
|
1297
|
+
...flowFactRefs,
|
|
1298
|
+
...equivalentNavigationRefs
|
|
1299
|
+
])
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
return id;
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
for (const binding of [...bindingFacts].sort((left, right) =>
|
|
1306
|
+
left.id.localeCompare(right.id, "en")
|
|
1307
|
+
)) {
|
|
1308
|
+
const controlRef = controlByUi.get(binding.data.elementKey);
|
|
1309
|
+
if (!controlRef) continue;
|
|
1310
|
+
const reachableCallbacks = callbackTraversal.resolve(
|
|
1311
|
+
binding.id,
|
|
1312
|
+
binding.data.callbackKey
|
|
1313
|
+
);
|
|
1314
|
+
const reachableByCallback = new Map<
|
|
1315
|
+
string,
|
|
1316
|
+
typeof reachableCallbacks
|
|
1317
|
+
>();
|
|
1318
|
+
for (const callback of reachableCallbacks) {
|
|
1319
|
+
const alternatives = reachableByCallback.get(
|
|
1320
|
+
callback.callbackKey
|
|
1321
|
+
) ?? [];
|
|
1322
|
+
alternatives.push(callback);
|
|
1323
|
+
reachableByCallback.set(callback.callbackKey, alternatives);
|
|
1324
|
+
}
|
|
1325
|
+
const callbackKeys = new Set(reachableByCallback.keys());
|
|
1326
|
+
const flowFactRefs = uniqueSorted(
|
|
1327
|
+
reachableCallbacks.flatMap((callback) =>
|
|
1328
|
+
callback.flowFactRefs
|
|
1329
|
+
)
|
|
1330
|
+
);
|
|
1331
|
+
const actionId = graphId(
|
|
1332
|
+
"action",
|
|
1333
|
+
source.caseId,
|
|
1334
|
+
binding.data.trigger,
|
|
1335
|
+
binding.id
|
|
1336
|
+
);
|
|
1337
|
+
actionByBinding.set(binding.id, actionId);
|
|
1338
|
+
const owningControl = controls.find(
|
|
1339
|
+
(control) => control.id === controlRef
|
|
1340
|
+
);
|
|
1341
|
+
const controlEnabledConditions =
|
|
1342
|
+
owningControl?.enabledConditions ?? [];
|
|
1343
|
+
const ownerArea = owningControl
|
|
1344
|
+
? areaById.get(owningControl.areaRef)
|
|
1345
|
+
: undefined;
|
|
1346
|
+
const activationScopedAreaKinds = new Set([
|
|
1347
|
+
"bottom-sheet",
|
|
1348
|
+
"dialog",
|
|
1349
|
+
"drawer",
|
|
1350
|
+
"overlay",
|
|
1351
|
+
"pager-page",
|
|
1352
|
+
"popup"
|
|
1353
|
+
]);
|
|
1354
|
+
const areaActivationExpressions =
|
|
1355
|
+
ownerArea && activationScopedAreaKinds.has(ownerArea.kind)
|
|
1356
|
+
? new Set(ownerArea.conditions.flatMap((conditionRef) => {
|
|
1357
|
+
const expression =
|
|
1358
|
+
conditionById.get(conditionRef)?.data.expressionAnchor.trim();
|
|
1359
|
+
return expression ? [expression] : [];
|
|
1360
|
+
}))
|
|
1361
|
+
: new Set<string>();
|
|
1362
|
+
const compatibleReachabilitiesByEffect = new Map<
|
|
1363
|
+
string,
|
|
1364
|
+
typeof reachableCallbacks
|
|
1365
|
+
>();
|
|
1366
|
+
const compatibleActionEffects = effectFacts
|
|
1367
|
+
.filter((effect) => {
|
|
1368
|
+
if (!callbackKeys.has(effect.data.callbackKey)) return false;
|
|
1369
|
+
const compatible = (
|
|
1370
|
+
reachableByCallback.get(effect.data.callbackKey) ?? []
|
|
1371
|
+
).filter((reachable) =>
|
|
1372
|
+
callbackTraversal.isCompatibleWithConditions(
|
|
1373
|
+
reachable,
|
|
1374
|
+
effect.data.conditionKeys ?? []
|
|
1375
|
+
)
|
|
1376
|
+
);
|
|
1377
|
+
if (compatible.length === 0) return false;
|
|
1378
|
+
compatibleReachabilitiesByEffect.set(effect.id, compatible);
|
|
1379
|
+
return true;
|
|
1380
|
+
});
|
|
1381
|
+
const compatibleEffectById = new Map(
|
|
1382
|
+
compatibleActionEffects.map((effect) => [effect.id, effect])
|
|
1383
|
+
);
|
|
1384
|
+
const supersededImplementationEffects = new Set<string>();
|
|
1385
|
+
for (const summary of compatibleActionEffects) {
|
|
1386
|
+
if (
|
|
1387
|
+
summary.data.effectKind !== "navigate-area" ||
|
|
1388
|
+
!hasResolvedAreaTarget(summary)
|
|
1389
|
+
) continue;
|
|
1390
|
+
for (const relatedRef of summary.relatedFactRefs ?? []) {
|
|
1391
|
+
const implementation = compatibleEffectById.get(relatedRef);
|
|
1392
|
+
if (
|
|
1393
|
+
implementation?.data.effectKind === "navigate-area" &&
|
|
1394
|
+
!hasResolvedAreaTarget(implementation)
|
|
1395
|
+
) {
|
|
1396
|
+
supersededImplementationEffects.add(implementation.id);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
const actionEffects = compatibleActionEffects
|
|
1401
|
+
.filter((effect) =>
|
|
1402
|
+
!supersededImplementationEffects.has(effect.id)
|
|
1403
|
+
)
|
|
1404
|
+
.sort((left, right) => left.id.localeCompare(right.id, "en"));
|
|
1405
|
+
const alternativesByEffect = new Map<
|
|
1406
|
+
string,
|
|
1407
|
+
ConditionAlternative[]
|
|
1408
|
+
>();
|
|
1409
|
+
for (const effect of actionEffects) {
|
|
1410
|
+
const reachabilities =
|
|
1411
|
+
compatibleReachabilitiesByEffect.get(effect.id) ?? [];
|
|
1412
|
+
const rawAlternatives = reachabilities.map((reachability) => {
|
|
1413
|
+
const callbackPath = new Set(reachability.callbackPath);
|
|
1414
|
+
const conditionRefs =
|
|
1415
|
+
effect.data.conditionKeys !== undefined
|
|
1416
|
+
? uniqueConditionRefs([
|
|
1417
|
+
...reachability.conditionRefs,
|
|
1418
|
+
...effect.data.conditionKeys
|
|
1419
|
+
]).filter((conditionRef) => {
|
|
1420
|
+
const expression = conditionById.get(
|
|
1421
|
+
conditionRef
|
|
1422
|
+
)?.data.expressionAnchor.trim();
|
|
1423
|
+
return !expression ||
|
|
1424
|
+
!areaActivationExpressions.has(expression);
|
|
1425
|
+
})
|
|
1426
|
+
: uniqueConditionRefs([
|
|
1427
|
+
...conditionFacts
|
|
1428
|
+
.filter((condition) =>
|
|
1429
|
+
callbackPath.has(condition.data.ownerKey)
|
|
1430
|
+
)
|
|
1431
|
+
.map((condition) => condition.id),
|
|
1432
|
+
...reachability.conditionRefs
|
|
1433
|
+
]).filter((conditionRef) => {
|
|
1434
|
+
const expression = conditionById.get(
|
|
1435
|
+
conditionRef
|
|
1436
|
+
)?.data.expressionAnchor.trim();
|
|
1437
|
+
return !expression ||
|
|
1438
|
+
!areaActivationExpressions.has(expression);
|
|
1439
|
+
});
|
|
1440
|
+
return {
|
|
1441
|
+
conditionRefs,
|
|
1442
|
+
sourceFactRefs: reachability.flowFactRefs
|
|
1443
|
+
};
|
|
1444
|
+
});
|
|
1445
|
+
alternativesByEffect.set(
|
|
1446
|
+
effect.id,
|
|
1447
|
+
normalizeConditionAlternatives(rawAlternatives)
|
|
1448
|
+
);
|
|
1449
|
+
}
|
|
1450
|
+
const action: Action = {
|
|
1451
|
+
id: actionId,
|
|
1452
|
+
controlRef,
|
|
1453
|
+
trigger: binding.data.trigger,
|
|
1454
|
+
effectRefs: [],
|
|
1455
|
+
/*
|
|
1456
|
+
* Callback-path guards describe whether an individual downstream effect
|
|
1457
|
+
* executes after the interaction. They are not prerequisites for the
|
|
1458
|
+
* user being able to trigger the control. Keep those guards on effects
|
|
1459
|
+
* (and navigation edges); Action preconditions are UI availability only.
|
|
1460
|
+
*/
|
|
1461
|
+
preconditionRefs: uniqueConditionRefs(controlEnabledConditions),
|
|
1462
|
+
sourceFactRefs: uniqueSorted([
|
|
1463
|
+
binding.id,
|
|
1464
|
+
...flowFactRefs
|
|
1465
|
+
])
|
|
1466
|
+
};
|
|
1467
|
+
const equivalentEffectGroups = new Map<
|
|
1468
|
+
string,
|
|
1469
|
+
SourceFact<"behavior-effect">[]
|
|
1470
|
+
>();
|
|
1471
|
+
for (const effect of actionEffects) {
|
|
1472
|
+
const semanticKey = exactTargetEffectSemanticKey(effect);
|
|
1473
|
+
const groupKey = semanticKey === undefined
|
|
1474
|
+
? `fact:${effect.id}`
|
|
1475
|
+
: `exact-target:${semanticKey}`;
|
|
1476
|
+
const group = equivalentEffectGroups.get(groupKey) ?? [];
|
|
1477
|
+
group.push(effect);
|
|
1478
|
+
equivalentEffectGroups.set(groupKey, group);
|
|
1479
|
+
}
|
|
1480
|
+
let effectRefs = [...equivalentEffectGroups.values()].map((group) => {
|
|
1481
|
+
const representative = group[0];
|
|
1482
|
+
return addEffectForAction(
|
|
1483
|
+
action,
|
|
1484
|
+
representative,
|
|
1485
|
+
normalizeConditionAlternatives(group.flatMap((effect) =>
|
|
1486
|
+
alternativesByEffect.get(effect.id) ?? []
|
|
1487
|
+
)),
|
|
1488
|
+
group
|
|
1489
|
+
);
|
|
1490
|
+
});
|
|
1491
|
+
let actionUnresolvedRef: string | undefined;
|
|
1492
|
+
if (effectRefs.length === 0) {
|
|
1493
|
+
const unknown = addUnknownEffectForAction(
|
|
1494
|
+
action,
|
|
1495
|
+
binding.id,
|
|
1496
|
+
action.sourceFactRefs,
|
|
1497
|
+
binding.support.map((item) => item.evidenceRef),
|
|
1498
|
+
"控件已绑定回调,但沿回调调用链没有解析到对应效果。"
|
|
1499
|
+
);
|
|
1500
|
+
effectRefs = [unknown.effectId];
|
|
1501
|
+
actionUnresolvedRef = unknown.unresolvedId;
|
|
1502
|
+
}
|
|
1503
|
+
actions.push({ ...action, effectRefs });
|
|
1504
|
+
const controlIndex = controls.findIndex((item) => item.id === controlRef);
|
|
1505
|
+
if (controlIndex >= 0) {
|
|
1506
|
+
controls[controlIndex] = {
|
|
1507
|
+
...controls[controlIndex],
|
|
1508
|
+
actionRefs: [...controls[controlIndex].actionRefs, actionId].sort(),
|
|
1509
|
+
...(actionUnresolvedRef
|
|
1510
|
+
? {
|
|
1511
|
+
unresolvedRefs: uniqueSorted([
|
|
1512
|
+
...controls[controlIndex].unresolvedRefs,
|
|
1513
|
+
actionUnresolvedRef
|
|
1514
|
+
])
|
|
1515
|
+
}
|
|
1516
|
+
: {})
|
|
1517
|
+
};
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
/*
|
|
1522
|
+
* Editable text has one intrinsic user interaction even when source code
|
|
1523
|
+
* only binds a separate submit/editor callback. This is an Android UI
|
|
1524
|
+
* contract, not a guessed business effect: typing changes the field value.
|
|
1525
|
+
*/
|
|
1526
|
+
for (const control of [...controls]) {
|
|
1527
|
+
if (control.kind !== "text-input") continue;
|
|
1528
|
+
const alreadyHasInput = control.actionRefs.some((actionRef) =>
|
|
1529
|
+
actions.some((action) =>
|
|
1530
|
+
action.id === actionRef && action.trigger === "text-input"
|
|
1531
|
+
)
|
|
1532
|
+
);
|
|
1533
|
+
if (alreadyHasInput) continue;
|
|
1534
|
+
const uiFact = uiFacts.find(
|
|
1535
|
+
(fact) => controlByUi.get(fact.id) === control.id
|
|
1536
|
+
);
|
|
1537
|
+
if (!uiFact) continue;
|
|
1538
|
+
const actionId = graphId(
|
|
1539
|
+
"action",
|
|
1540
|
+
source.caseId,
|
|
1541
|
+
"text-input",
|
|
1542
|
+
`${uiFact.id}:intrinsic-input`
|
|
1543
|
+
);
|
|
1544
|
+
const effectId = graphId(
|
|
1545
|
+
"effect",
|
|
1546
|
+
source.caseId,
|
|
1547
|
+
"input",
|
|
1548
|
+
actionId
|
|
1549
|
+
);
|
|
1550
|
+
actions.push({
|
|
1551
|
+
id: actionId,
|
|
1552
|
+
controlRef: control.id,
|
|
1553
|
+
trigger: "text-input",
|
|
1554
|
+
effectRefs: [effectId],
|
|
1555
|
+
preconditionRefs: [...control.enabledConditions],
|
|
1556
|
+
sourceFactRefs: [uiFact.id]
|
|
1557
|
+
});
|
|
1558
|
+
effects.push({
|
|
1559
|
+
id: effectId,
|
|
1560
|
+
actionRef: actionId,
|
|
1561
|
+
kind: "input",
|
|
1562
|
+
description: resolved(
|
|
1563
|
+
"接收并处理用户输入",
|
|
1564
|
+
[uiFact.id],
|
|
1565
|
+
uiFact.confidence
|
|
1566
|
+
),
|
|
1567
|
+
sourceFactRefs: [uiFact.id],
|
|
1568
|
+
unresolvedRefs: []
|
|
1569
|
+
});
|
|
1570
|
+
const index = controls.findIndex((item) => item.id === control.id);
|
|
1571
|
+
controls[index] = {
|
|
1572
|
+
...controls[index],
|
|
1573
|
+
actionRefs: uniqueSorted([
|
|
1574
|
+
...controls[index].actionRefs,
|
|
1575
|
+
actionId
|
|
1576
|
+
])
|
|
1577
|
+
};
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
for (const control of [...controls]) {
|
|
1581
|
+
if (control.actionRefs.length > 0) continue;
|
|
1582
|
+
const uiFact = uiFacts.find(
|
|
1583
|
+
(fact) => controlByUi.get(fact.id) === control.id
|
|
1584
|
+
);
|
|
1585
|
+
if (!uiFact) continue;
|
|
1586
|
+
const actionId = graphId(
|
|
1587
|
+
"action",
|
|
1588
|
+
source.caseId,
|
|
1589
|
+
inferredTrigger(uiFact.data),
|
|
1590
|
+
`${uiFact.id}:unbound`
|
|
1591
|
+
);
|
|
1592
|
+
const action: Action = {
|
|
1593
|
+
id: actionId,
|
|
1594
|
+
controlRef: control.id,
|
|
1595
|
+
trigger: inferredTrigger(uiFact.data),
|
|
1596
|
+
effectRefs: [],
|
|
1597
|
+
preconditionRefs: [...control.enabledConditions],
|
|
1598
|
+
sourceFactRefs: [uiFact.id]
|
|
1599
|
+
};
|
|
1600
|
+
const unknown = addUnknownEffectForAction(
|
|
1601
|
+
action,
|
|
1602
|
+
uiFact.id,
|
|
1603
|
+
action.sourceFactRefs,
|
|
1604
|
+
uiFact.support.map((item) => item.evidenceRef),
|
|
1605
|
+
"控件可操作,但在所选源码中没有解析到对应回调效果。"
|
|
1606
|
+
);
|
|
1607
|
+
actions.push({ ...action, effectRefs: [unknown.effectId] });
|
|
1608
|
+
const index = controls.findIndex((item) => item.id === control.id);
|
|
1609
|
+
controls[index] = {
|
|
1610
|
+
...controls[index],
|
|
1611
|
+
actionRefs: [actionId],
|
|
1612
|
+
unresolvedRefs: uniqueSorted([
|
|
1613
|
+
...controls[index].unresolvedRefs,
|
|
1614
|
+
unknown.unresolvedId
|
|
1615
|
+
])
|
|
1616
|
+
};
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
applyComponentVariants({
|
|
1620
|
+
caseId: source.caseId,
|
|
1621
|
+
variants: componentVariantFacts,
|
|
1622
|
+
areaByComponent,
|
|
1623
|
+
areasById: areaById,
|
|
1624
|
+
controls,
|
|
1625
|
+
actions,
|
|
1626
|
+
effects,
|
|
1627
|
+
edges,
|
|
1628
|
+
unresolved,
|
|
1629
|
+
bindings: bindingFacts,
|
|
1630
|
+
conditions: conditionFacts,
|
|
1631
|
+
id: graphId
|
|
1632
|
+
});
|
|
1633
|
+
|
|
1634
|
+
/*
|
|
1635
|
+
* A user action that resolves back to its own Area is still a real control
|
|
1636
|
+
* with a real effect, but it is not a transition between graph nodes. This
|
|
1637
|
+
* commonly occurs when the selected Pager tab is clicked again. Remove the
|
|
1638
|
+
* self-loop only after component variants have been expanded so the check
|
|
1639
|
+
* uses final Area identities. Startup settling is derived independently
|
|
1640
|
+
* from source effects below and therefore remains unaffected.
|
|
1641
|
+
*/
|
|
1642
|
+
for (let index = edges.length - 1; index >= 0; index -= 1) {
|
|
1643
|
+
const edge = edges[index];
|
|
1644
|
+
if (
|
|
1645
|
+
!("status" in edge.target) &&
|
|
1646
|
+
edge.target.kind === "area" &&
|
|
1647
|
+
edge.target.ref === edge.sourceAreaRef
|
|
1648
|
+
) {
|
|
1649
|
+
edges.splice(index, 1);
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
/*
|
|
1654
|
+
* A close/back API carries no literal destination. When the static graph
|
|
1655
|
+
* proves one or more in-app predecessors, materialize the possible history
|
|
1656
|
+
* transitions from that evidence. Use a snapshot of forward edges so a
|
|
1657
|
+
* generated back edge can never become proof for another generated edge.
|
|
1658
|
+
*
|
|
1659
|
+
* An action can atomically close the current surface and show another one.
|
|
1660
|
+
* That is a replacement transition: it must not also emit a return edge,
|
|
1661
|
+
* and the new surface inherits the replaced surface's predecessors rather
|
|
1662
|
+
* than treating the replaced surface as its back destination.
|
|
1663
|
+
*/
|
|
1664
|
+
const forwardEdges = [...edges];
|
|
1665
|
+
const actionById = new Map(actions.map((action) => [action.id, action]));
|
|
1666
|
+
const effectById = new Map(effects.map((effect) => [effect.id, effect]));
|
|
1667
|
+
const actionHasEffect = (
|
|
1668
|
+
action: Action,
|
|
1669
|
+
kinds: ReadonlySet<string>
|
|
1670
|
+
): boolean => action.effectRefs.some((effectRef) => {
|
|
1671
|
+
const effect = effectById.get(effectRef);
|
|
1672
|
+
return effect !== undefined && kinds.has(effect.kind);
|
|
1673
|
+
});
|
|
1674
|
+
const closeKinds = new Set(["close-surface"]);
|
|
1675
|
+
const transitionKinds = new Set([
|
|
1676
|
+
"navigate-area",
|
|
1677
|
+
"show-surface",
|
|
1678
|
+
"open-external"
|
|
1679
|
+
]);
|
|
1680
|
+
interface HistoryProof {
|
|
1681
|
+
readonly predecessorAreaRef: string;
|
|
1682
|
+
readonly edges: readonly Edge[];
|
|
1683
|
+
}
|
|
1684
|
+
const historyProofsFor = (
|
|
1685
|
+
targetAreaRef: string,
|
|
1686
|
+
visiting: ReadonlySet<string> = new Set()
|
|
1687
|
+
): HistoryProof[] => {
|
|
1688
|
+
if (visiting.has(targetAreaRef)) return [];
|
|
1689
|
+
const nextVisiting = new Set([...visiting, targetAreaRef]);
|
|
1690
|
+
const proofs: HistoryProof[] = [];
|
|
1691
|
+
for (const edge of forwardEdges) {
|
|
1692
|
+
if (
|
|
1693
|
+
"status" in edge.target ||
|
|
1694
|
+
edge.target.kind !== "area" ||
|
|
1695
|
+
edge.target.ref !== targetAreaRef ||
|
|
1696
|
+
edge.sourceAreaRef === targetAreaRef
|
|
1697
|
+
) continue;
|
|
1698
|
+
const incomingAction = actionById.get(edge.actionRef);
|
|
1699
|
+
if (
|
|
1700
|
+
incomingAction &&
|
|
1701
|
+
actionHasEffect(incomingAction, closeKinds)
|
|
1702
|
+
) {
|
|
1703
|
+
for (const inherited of historyProofsFor(
|
|
1704
|
+
edge.sourceAreaRef,
|
|
1705
|
+
nextVisiting
|
|
1706
|
+
)) {
|
|
1707
|
+
proofs.push({
|
|
1708
|
+
predecessorAreaRef: inherited.predecessorAreaRef,
|
|
1709
|
+
edges: [...inherited.edges, edge]
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1712
|
+
} else {
|
|
1713
|
+
proofs.push({
|
|
1714
|
+
predecessorAreaRef: edge.sourceAreaRef,
|
|
1715
|
+
edges: [edge]
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
const unique = new Map<string, HistoryProof>();
|
|
1720
|
+
for (const proof of proofs) {
|
|
1721
|
+
const key = [
|
|
1722
|
+
proof.predecessorAreaRef,
|
|
1723
|
+
...proof.edges.map((edge) => edge.id)
|
|
1724
|
+
].join("\u0000");
|
|
1725
|
+
unique.set(key, proof);
|
|
1726
|
+
}
|
|
1727
|
+
return [...unique.values()];
|
|
1728
|
+
};
|
|
1729
|
+
const closeEffectsByAction = new Map<string, Effect[]>();
|
|
1730
|
+
for (const closeEffect of effects.filter(
|
|
1731
|
+
(effect) =>
|
|
1732
|
+
effect.kind === "close-surface" &&
|
|
1733
|
+
effect.closePolicy !== "host-exit"
|
|
1734
|
+
)) {
|
|
1735
|
+
const grouped = closeEffectsByAction.get(closeEffect.actionRef) ?? [];
|
|
1736
|
+
grouped.push(closeEffect);
|
|
1737
|
+
closeEffectsByAction.set(closeEffect.actionRef, grouped);
|
|
1738
|
+
}
|
|
1739
|
+
// One user event may reach several implementation callbacks that all close
|
|
1740
|
+
// the same surface. They remain separate effect evidence, but history has
|
|
1741
|
+
// only one transition for that Action and predecessor Area.
|
|
1742
|
+
for (const [closeActionRef, closeEffects] of closeEffectsByAction) {
|
|
1743
|
+
const action = actions.find(
|
|
1744
|
+
(candidate) => candidate.id === closeActionRef
|
|
1745
|
+
);
|
|
1746
|
+
const control = action
|
|
1747
|
+
? controls.find((candidate) => candidate.id === action.controlRef)
|
|
1748
|
+
: undefined;
|
|
1749
|
+
if (!action || !control) continue;
|
|
1750
|
+
if (actionHasEffect(action, transitionKinds)) {
|
|
1751
|
+
continue;
|
|
1752
|
+
}
|
|
1753
|
+
const proofByPredecessor = new Map<string, Edge[]>();
|
|
1754
|
+
for (const proof of historyProofsFor(control.areaRef)) {
|
|
1755
|
+
const edgesForArea = proofByPredecessor.get(
|
|
1756
|
+
proof.predecessorAreaRef
|
|
1757
|
+
) ?? [];
|
|
1758
|
+
edgesForArea.push(...proof.edges);
|
|
1759
|
+
proofByPredecessor.set(
|
|
1760
|
+
proof.predecessorAreaRef,
|
|
1761
|
+
edgesForArea
|
|
1762
|
+
);
|
|
1763
|
+
}
|
|
1764
|
+
for (const [predecessorAreaRef, proofs] of proofByPredecessor) {
|
|
1765
|
+
edges.push({
|
|
1766
|
+
id: graphId(
|
|
1767
|
+
"edge",
|
|
1768
|
+
source.caseId,
|
|
1769
|
+
"history-back",
|
|
1770
|
+
`${control.areaRef}:${action.id}:${predecessorAreaRef}`
|
|
1771
|
+
),
|
|
1772
|
+
sourceAreaRef: control.areaRef,
|
|
1773
|
+
controlRef: control.id,
|
|
1774
|
+
actionRef: action.id,
|
|
1775
|
+
target: { kind: "area", ref: predecessorAreaRef },
|
|
1776
|
+
conditions: uniqueConditionRefs(
|
|
1777
|
+
proofs.flatMap((proof) => proof.conditions)
|
|
1778
|
+
),
|
|
1779
|
+
preconditions: uniqueSorted(
|
|
1780
|
+
proofs.flatMap((proof) => proof.preconditions)
|
|
1781
|
+
),
|
|
1782
|
+
sourceFactRefs: uniqueSorted([
|
|
1783
|
+
...closeEffects.flatMap((effect) => effect.sourceFactRefs),
|
|
1784
|
+
...proofs.flatMap((proof) => proof.sourceFactRefs)
|
|
1785
|
+
])
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
const entryPoints: EntryPoint[] = [];
|
|
1791
|
+
const startupPromotedAreaRefs = new Set<string>();
|
|
1792
|
+
const entryFactById = new Map(entryFacts.map((fact) => [fact.id, fact]));
|
|
1793
|
+
const launcherFactsWithDerivedDefault = new Set(
|
|
1794
|
+
entryFacts.flatMap((fact) =>
|
|
1795
|
+
fact.data.startupRole === "default" && fact.data.parentEntryKey
|
|
1796
|
+
? [fact.data.parentEntryKey]
|
|
1797
|
+
: []
|
|
1798
|
+
)
|
|
1799
|
+
);
|
|
1800
|
+
const callbackById = new Map(
|
|
1801
|
+
callbackFacts.map((callback) => [callback.id, callback])
|
|
1802
|
+
);
|
|
1803
|
+
for (const fact of entryFacts) {
|
|
1804
|
+
/*
|
|
1805
|
+
* A finite startup resolver replaces its technical Activity/shell root
|
|
1806
|
+
* with the proven visible default Area. Keeping both roots would make the
|
|
1807
|
+
* shell compete with its own content and reintroduce arbitrary paths.
|
|
1808
|
+
*/
|
|
1809
|
+
if (launcherFactsWithDerivedDefault.has(fact.id)) continue;
|
|
1810
|
+
const root = areaByComponent.get(fact.data.componentKey);
|
|
1811
|
+
if (!root || !areaById.has(root)) {
|
|
1812
|
+
unresolved.push({
|
|
1813
|
+
id: graphId(
|
|
1814
|
+
"unresolved",
|
|
1815
|
+
source.caseId,
|
|
1816
|
+
"entry-root",
|
|
1817
|
+
fact.id
|
|
1818
|
+
),
|
|
1819
|
+
ownerRef: fact.id,
|
|
1820
|
+
fieldPath: "rootAreaRefs",
|
|
1821
|
+
reasonCode: "INTRINSIC_ENTRY_ROOT_UNKNOWN",
|
|
1822
|
+
message:
|
|
1823
|
+
"入口组件无法映射到可遍历 Area;该入口未参与路径计算。",
|
|
1824
|
+
evidenceRefs: fact.support.map((item) => item.evidenceRef),
|
|
1825
|
+
candidates: [],
|
|
1826
|
+
impact: ["area-path"],
|
|
1827
|
+
originRef: fact.id
|
|
1828
|
+
});
|
|
1829
|
+
continue;
|
|
1830
|
+
}
|
|
1831
|
+
const rootArea = areaById.get(root);
|
|
1832
|
+
const rootConditions = rootArea?.conditions ?? [];
|
|
1833
|
+
if (
|
|
1834
|
+
fact.data.entryKind === "launcher" &&
|
|
1835
|
+
fact.data.category === "normal"
|
|
1836
|
+
) {
|
|
1837
|
+
const startupCallbacks = callbackFacts.filter((callback) =>
|
|
1838
|
+
callback.data.ownerKey === fact.data.componentKey &&
|
|
1839
|
+
callback.data.callbackKind === "function" &&
|
|
1840
|
+
/#onCreate\(/u.test(callback.data.callableSymbol)
|
|
1841
|
+
);
|
|
1842
|
+
const lifecyclePagerTransitions = effectFacts.flatMap((effect) => {
|
|
1843
|
+
if (
|
|
1844
|
+
effect.data.effectKind !== "navigate-area" ||
|
|
1845
|
+
effect.data.transitionMode !== "startup-auto" ||
|
|
1846
|
+
!effect.data.targetKey
|
|
1847
|
+
) return [];
|
|
1848
|
+
const callback = callbackById.get(effect.data.callbackKey);
|
|
1849
|
+
const callbackAreaRef = callback
|
|
1850
|
+
? areaByComponent.get(callback.data.ownerKey)
|
|
1851
|
+
: undefined;
|
|
1852
|
+
const targetAreaRef = areaByComponent.get(effect.data.targetKey);
|
|
1853
|
+
if (
|
|
1854
|
+
callbackAreaRef !== root ||
|
|
1855
|
+
!targetAreaRef ||
|
|
1856
|
+
targetAreaRef === root
|
|
1857
|
+
) return [];
|
|
1858
|
+
const transitionConditions = uniqueConditionRefs(
|
|
1859
|
+
effect.data.conditionKeys ?? []
|
|
1860
|
+
);
|
|
1861
|
+
return [{
|
|
1862
|
+
effect,
|
|
1863
|
+
targetAreaRef,
|
|
1864
|
+
transitionConditions,
|
|
1865
|
+
conditions: uniqueConditionRefs([
|
|
1866
|
+
...fact.data.conditionKeys,
|
|
1867
|
+
...transitionConditions
|
|
1868
|
+
]),
|
|
1869
|
+
flowFactRefs: [] as string[]
|
|
1870
|
+
}];
|
|
1871
|
+
});
|
|
1872
|
+
const callbackStartupTransitions = startupCallbacks.flatMap(
|
|
1873
|
+
(startupCallback) =>
|
|
1874
|
+
callbackTraversal.resolve(
|
|
1875
|
+
`${fact.id}:startup:${startupCallback.id}`,
|
|
1876
|
+
startupCallback.id
|
|
1877
|
+
).flatMap((reachability) =>
|
|
1878
|
+
effectFacts
|
|
1879
|
+
.filter((effect) =>
|
|
1880
|
+
effect.data.effectKind === "navigate-area" &&
|
|
1881
|
+
effect.data.targetKey !== undefined &&
|
|
1882
|
+
effect.data.callbackKey === reachability.callbackKey
|
|
1883
|
+
)
|
|
1884
|
+
.flatMap((effect) => {
|
|
1885
|
+
const targetAreaRef = effect.data.targetKey
|
|
1886
|
+
? areaByComponent.get(effect.data.targetKey)
|
|
1887
|
+
: undefined;
|
|
1888
|
+
const transitionConditions = uniqueConditionRefs([
|
|
1889
|
+
...reachability.conditionRefs,
|
|
1890
|
+
...(effect.data.conditionKeys ?? [])
|
|
1891
|
+
]);
|
|
1892
|
+
return targetAreaRef &&
|
|
1893
|
+
targetAreaRef !== root &&
|
|
1894
|
+
transitionConditions.length > 0
|
|
1895
|
+
? [{
|
|
1896
|
+
effect,
|
|
1897
|
+
targetAreaRef,
|
|
1898
|
+
transitionConditions,
|
|
1899
|
+
conditions: uniqueConditionRefs([
|
|
1900
|
+
...fact.data.conditionKeys,
|
|
1901
|
+
...transitionConditions
|
|
1902
|
+
]),
|
|
1903
|
+
flowFactRefs: reachability.flowFactRefs
|
|
1904
|
+
}]
|
|
1905
|
+
: [];
|
|
1906
|
+
})
|
|
1907
|
+
)
|
|
1908
|
+
);
|
|
1909
|
+
const startupTransitions = [
|
|
1910
|
+
...lifecyclePagerTransitions,
|
|
1911
|
+
...callbackStartupTransitions
|
|
1912
|
+
];
|
|
1913
|
+
const seenTransitions = new Set<string>();
|
|
1914
|
+
for (const transition of startupTransitions) {
|
|
1915
|
+
const conditions = transition.conditions;
|
|
1916
|
+
const transitionKey =
|
|
1917
|
+
`${transition.targetAreaRef}\u0000${conditions.join("|")}`;
|
|
1918
|
+
if (seenTransitions.has(transitionKey)) continue;
|
|
1919
|
+
seenTransitions.add(transitionKey);
|
|
1920
|
+
const targetArea = areaById.get(transition.targetAreaRef);
|
|
1921
|
+
if (targetArea) {
|
|
1922
|
+
startupPromotedAreaRefs.add(transition.targetAreaRef);
|
|
1923
|
+
areaById.set(transition.targetAreaRef, {
|
|
1924
|
+
...targetArea,
|
|
1925
|
+
conditions: uniqueConditionRefs([
|
|
1926
|
+
...targetArea.conditions,
|
|
1927
|
+
...conditions
|
|
1928
|
+
]),
|
|
1929
|
+
sourceFactRefs: uniqueSorted([
|
|
1930
|
+
...targetArea.sourceFactRefs,
|
|
1931
|
+
transition.effect.id,
|
|
1932
|
+
...transition.flowFactRefs,
|
|
1933
|
+
...conditions
|
|
1934
|
+
])
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
entryPoints.push({
|
|
1938
|
+
id: graphId(
|
|
1939
|
+
"entry",
|
|
1940
|
+
source.caseId,
|
|
1941
|
+
fact.data.entryKind,
|
|
1942
|
+
`${fact.id}:${transitionKey}`
|
|
1943
|
+
),
|
|
1944
|
+
kind: fact.data.entryKind,
|
|
1945
|
+
category: fact.data.category,
|
|
1946
|
+
rootAreaRefs: [transition.targetAreaRef],
|
|
1947
|
+
conditions,
|
|
1948
|
+
preconditions: conditions,
|
|
1949
|
+
startupRole: "conditional",
|
|
1950
|
+
launcherAreaRef: root,
|
|
1951
|
+
sourceFactRefs: uniqueSorted([
|
|
1952
|
+
fact.id,
|
|
1953
|
+
transition.effect.id,
|
|
1954
|
+
...transition.flowFactRefs,
|
|
1955
|
+
...conditions
|
|
1956
|
+
])
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
const deterministicStartupTarget = (() => {
|
|
1960
|
+
const unique = [...new Map(
|
|
1961
|
+
startupTransitions.map((transition) => [
|
|
1962
|
+
[
|
|
1963
|
+
transition.targetAreaRef,
|
|
1964
|
+
...transition.transitionConditions
|
|
1965
|
+
].join("\u0000"),
|
|
1966
|
+
transition
|
|
1967
|
+
])
|
|
1968
|
+
).values()];
|
|
1969
|
+
return unique.length === 1 &&
|
|
1970
|
+
unique[0].transitionConditions.length === 0
|
|
1971
|
+
? unique[0].targetAreaRef
|
|
1972
|
+
: undefined;
|
|
1973
|
+
})();
|
|
1974
|
+
if (deterministicStartupTarget) {
|
|
1975
|
+
continue;
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
const parentEntry = fact.data.parentEntryKey
|
|
1979
|
+
? entryFactById.get(fact.data.parentEntryKey)
|
|
1980
|
+
: undefined;
|
|
1981
|
+
const parentRoot = parentEntry
|
|
1982
|
+
? areaByComponent.get(parentEntry.data.componentKey)
|
|
1983
|
+
: undefined;
|
|
1984
|
+
const launcherAreaRef = parentRoot ?? root;
|
|
1985
|
+
entryPoints.push({
|
|
1986
|
+
id: graphId(
|
|
1987
|
+
"entry",
|
|
1988
|
+
source.caseId,
|
|
1989
|
+
fact.data.entryKind,
|
|
1990
|
+
fact.id
|
|
1991
|
+
),
|
|
1992
|
+
kind: fact.data.entryKind,
|
|
1993
|
+
category: fact.data.category,
|
|
1994
|
+
rootAreaRefs: uniqueSorted([
|
|
1995
|
+
root,
|
|
1996
|
+
...(fact.data.parentEntryKey && launcherAreaRef !== root
|
|
1997
|
+
? [launcherAreaRef]
|
|
1998
|
+
: [])
|
|
1999
|
+
]),
|
|
2000
|
+
conditions: uniqueConditionRefs([
|
|
2001
|
+
...fact.data.conditionKeys,
|
|
2002
|
+
...rootConditions.filter((conditionRef) =>
|
|
2003
|
+
conditionById.get(conditionRef)?.data.ownerKey ===
|
|
2004
|
+
fact.data.componentKey
|
|
2005
|
+
)
|
|
2006
|
+
]),
|
|
2007
|
+
preconditions: uniqueConditionRefs(
|
|
2008
|
+
fact.data.preconditionKeys ?? fact.data.conditionKeys
|
|
2009
|
+
),
|
|
2010
|
+
startupRole: fact.data.startupRole ?? (
|
|
2011
|
+
fact.data.entryKind === "launcher" &&
|
|
2012
|
+
fact.data.category === "normal" &&
|
|
2013
|
+
fact.data.conditionKeys.length === 0
|
|
2014
|
+
? "default"
|
|
2015
|
+
: "conditional"
|
|
2016
|
+
),
|
|
2017
|
+
launcherAreaRef,
|
|
2018
|
+
sourceFactRefs: uniqueSorted([
|
|
2019
|
+
fact.id,
|
|
2020
|
+
...fact.data.conditionKeys,
|
|
2021
|
+
...(fact.data.preconditionKeys ?? []),
|
|
2022
|
+
...(fact.data.parentEntryKey ? [fact.data.parentEntryKey] : []),
|
|
2023
|
+
...rootConditions.filter((conditionRef) =>
|
|
2024
|
+
conditionById.get(conditionRef)?.data.ownerKey ===
|
|
2025
|
+
fact.data.componentKey
|
|
2026
|
+
)
|
|
2027
|
+
])
|
|
2028
|
+
});
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
/*
|
|
2032
|
+
* Startup branch analysis can promote a redirect target to a conditioned
|
|
2033
|
+
* launcher root after controls and forward edges have already been built.
|
|
2034
|
+
* Re-apply the final source-Area conditions to outgoing edges so paths and
|
|
2035
|
+
* REQ descriptions do not lose that proven entry predicate.
|
|
2036
|
+
*/
|
|
2037
|
+
for (let index = 0; index < edges.length; index += 1) {
|
|
2038
|
+
const edge = edges[index];
|
|
2039
|
+
if (!startupPromotedAreaRefs.has(edge.sourceAreaRef)) continue;
|
|
2040
|
+
const updated = {
|
|
2041
|
+
...edge,
|
|
2042
|
+
conditions: uniqueConditionRefs([
|
|
2043
|
+
...(areaById.get(edge.sourceAreaRef)?.conditions ?? []),
|
|
2044
|
+
...edge.conditions
|
|
2045
|
+
])
|
|
2046
|
+
};
|
|
2047
|
+
edges[index] = updated;
|
|
2048
|
+
const forwardIndex = forwardEdges.findIndex(
|
|
2049
|
+
(candidate) => candidate.id === edge.id
|
|
2050
|
+
);
|
|
2051
|
+
if (forwardIndex >= 0) forwardEdges[forwardIndex] = updated;
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
/*
|
|
2055
|
+
* A title-less popup is perceived in the context of the control that opens
|
|
2056
|
+
* it. Derive that contextual product label only after the show edge is
|
|
2057
|
+
* proven. Generic overflow/menu openers use the host Area name (for example
|
|
2058
|
+
* "Playlist menu"); a semantic opener such as "Choose language" names its
|
|
2059
|
+
* own menu. No framework class name or application-specific vocabulary is
|
|
2060
|
+
* involved.
|
|
2061
|
+
*/
|
|
2062
|
+
for (const area of areaById.values()) {
|
|
2063
|
+
if (area.kind !== "popup" || area.name.status !== "unresolved") continue;
|
|
2064
|
+
const incoming = edges.filter((edge) => {
|
|
2065
|
+
if (
|
|
2066
|
+
"status" in edge.target ||
|
|
2067
|
+
edge.target.kind !== "area" ||
|
|
2068
|
+
edge.target.ref !== area.id
|
|
2069
|
+
) return false;
|
|
2070
|
+
const action = actionById.get(edge.actionRef);
|
|
2071
|
+
return action?.effectRefs.some((effectRef) =>
|
|
2072
|
+
effectById.get(effectRef)?.kind === "show-surface"
|
|
2073
|
+
) === true;
|
|
2074
|
+
});
|
|
2075
|
+
const sourceAreaRefs = [...new Set(
|
|
2076
|
+
incoming.map((edge) => edge.sourceAreaRef)
|
|
2077
|
+
)];
|
|
2078
|
+
if (incoming.length === 0 || sourceAreaRefs.length !== 1) continue;
|
|
2079
|
+
const sourceArea = areaById.get(sourceAreaRefs[0]);
|
|
2080
|
+
const openerNames = [...new Set(incoming.flatMap((edge) => {
|
|
2081
|
+
const control = controls.find((candidate) =>
|
|
2082
|
+
candidate.id === edge.controlRef
|
|
2083
|
+
);
|
|
2084
|
+
return control?.name.status === "resolved"
|
|
2085
|
+
? [control.name.value]
|
|
2086
|
+
: [];
|
|
2087
|
+
}))];
|
|
2088
|
+
const openerName = openerNames.length === 1 ? openerNames[0] : undefined;
|
|
2089
|
+
const hostName = sourceArea?.name.status === "resolved"
|
|
2090
|
+
? sourceArea.name.value
|
|
2091
|
+
: undefined;
|
|
2092
|
+
const baseName = openerName && !genericMenuOpenerName(openerName)
|
|
2093
|
+
? openerName
|
|
2094
|
+
: hostName ?? openerName;
|
|
2095
|
+
if (!baseName) continue;
|
|
2096
|
+
const supportRefs = uniqueSorted([
|
|
2097
|
+
...incoming.flatMap((edge) => edge.sourceFactRefs),
|
|
2098
|
+
...incoming.flatMap((edge) => {
|
|
2099
|
+
const control = controls.find((candidate) =>
|
|
2100
|
+
candidate.id === edge.controlRef
|
|
2101
|
+
);
|
|
2102
|
+
return control?.name.status === "resolved"
|
|
2103
|
+
? control.name.supportRefs
|
|
2104
|
+
: [];
|
|
2105
|
+
}),
|
|
2106
|
+
...(sourceArea?.name.status === "resolved"
|
|
2107
|
+
? sourceArea.name.supportRefs
|
|
2108
|
+
: [])
|
|
2109
|
+
]);
|
|
2110
|
+
const oldUnresolvedRef = area.name.unresolvedRef;
|
|
2111
|
+
const unresolvedIndex = unresolved.findIndex((candidate) =>
|
|
2112
|
+
candidate.id === oldUnresolvedRef
|
|
2113
|
+
);
|
|
2114
|
+
if (unresolvedIndex >= 0) unresolved.splice(unresolvedIndex, 1);
|
|
2115
|
+
areaById.set(area.id, {
|
|
2116
|
+
...area,
|
|
2117
|
+
name: resolved(contextualMenuName(baseName), supportRefs, "medium"),
|
|
2118
|
+
unresolvedRefs: area.unresolvedRefs.filter((ref) =>
|
|
2119
|
+
ref !== oldUnresolvedRef
|
|
2120
|
+
)
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
const controlById = new Map(
|
|
2125
|
+
controls.map((control) => [control.id, control])
|
|
2126
|
+
);
|
|
2127
|
+
const pathEdges = forwardEdges.filter((edge) => {
|
|
2128
|
+
const enabled = controlById.get(edge.controlRef)?.enabled;
|
|
2129
|
+
return enabled?.status !== "resolved" || enabled.value !== false;
|
|
2130
|
+
});
|
|
2131
|
+
const pathDrafts = computePaths({
|
|
2132
|
+
areas: [...areaById.values()],
|
|
2133
|
+
edges: pathEdges,
|
|
2134
|
+
entryPoints
|
|
2135
|
+
}, {
|
|
2136
|
+
maxGraphStates: options.maxGraphStates,
|
|
2137
|
+
conditionExpressions: new Map(
|
|
2138
|
+
conditionFacts.map((condition) => [
|
|
2139
|
+
condition.id,
|
|
2140
|
+
condition.data.expressionAnchor
|
|
2141
|
+
])
|
|
2142
|
+
)
|
|
2143
|
+
});
|
|
2144
|
+
const paths: AreaPath[] = pathDrafts.map((path) => ({
|
|
2145
|
+
...path,
|
|
2146
|
+
id: graphId(
|
|
2147
|
+
"path",
|
|
2148
|
+
source.caseId,
|
|
2149
|
+
path.kind,
|
|
2150
|
+
[
|
|
2151
|
+
path.targetAreaRef,
|
|
2152
|
+
path.rootEntryRef ?? "none",
|
|
2153
|
+
...path.steps.map((step) => step.edgeRef)
|
|
2154
|
+
].join("|")
|
|
2155
|
+
),
|
|
2156
|
+
selectionReasons: path.kind === "canonical"
|
|
2157
|
+
? ["shortest normal-launcher path"]
|
|
2158
|
+
: path.kind === "equivalent"
|
|
2159
|
+
? ["equal-cost normal-launcher path"]
|
|
2160
|
+
: path.kind === "alternate"
|
|
2161
|
+
? ["alternate entry path"]
|
|
2162
|
+
: ["not reachable from a normal launcher"],
|
|
2163
|
+
unresolvedRefs: []
|
|
2164
|
+
}));
|
|
2165
|
+
const canonicalByArea = new Map(
|
|
2166
|
+
paths
|
|
2167
|
+
.filter((path) =>
|
|
2168
|
+
path.kind === "canonical" || path.kind === "unreachable"
|
|
2169
|
+
)
|
|
2170
|
+
.map((path) => [path.targetAreaRef, path.id])
|
|
2171
|
+
);
|
|
2172
|
+
const areas = sorted(
|
|
2173
|
+
[...areaById.values()].map((area) => ({
|
|
2174
|
+
...area,
|
|
2175
|
+
...(canonicalByArea.has(area.id)
|
|
2176
|
+
? { canonicalPathRef: canonicalByArea.get(area.id) }
|
|
2177
|
+
: {})
|
|
2178
|
+
}))
|
|
2179
|
+
);
|
|
2180
|
+
const document: AreaGraphDocument = {
|
|
2181
|
+
schemaVersion: "2.0.0",
|
|
2182
|
+
artifactKind: "area-graph",
|
|
2183
|
+
caseId: source.caseId,
|
|
2184
|
+
analysisContext: source.analysisContext as AnalysisContext,
|
|
2185
|
+
areaControl: {
|
|
2186
|
+
areas,
|
|
2187
|
+
controls: sorted(controls),
|
|
2188
|
+
externalEndpoints: sorted(externalEndpoints),
|
|
2189
|
+
entryPoints: sorted(entryPoints),
|
|
2190
|
+
excludedAreaCandidates: ownership.exclusions.map((exclusion) => ({
|
|
2191
|
+
...exclusion,
|
|
2192
|
+
sourceFactRefs: [exclusion.componentRef]
|
|
2193
|
+
}))
|
|
2194
|
+
},
|
|
2195
|
+
actionEffect: {
|
|
2196
|
+
actions: sorted(actions),
|
|
2197
|
+
effects: sorted(effects),
|
|
2198
|
+
edges: sorted(edges),
|
|
2199
|
+
paths: sorted(paths)
|
|
2200
|
+
},
|
|
2201
|
+
unresolved: sorted(
|
|
2202
|
+
[...new Map(unresolved.map((item) => [item.id, item])).values()]
|
|
2203
|
+
)
|
|
2204
|
+
};
|
|
2205
|
+
const graph = withAreaGraphFlatViews(document);
|
|
2206
|
+
const validation = validateAreaGraph(graph);
|
|
2207
|
+
if (!validation.ok) {
|
|
2208
|
+
throw new Error(
|
|
2209
|
+
`Area graph invariants failed: ${
|
|
2210
|
+
validation.issues.map((item) =>
|
|
2211
|
+
`${item.code}@${item.path}: ${item.message}`
|
|
2212
|
+
).join(", ")
|
|
2213
|
+
}`
|
|
2214
|
+
);
|
|
2215
|
+
}
|
|
2216
|
+
return graph;
|
|
2217
|
+
}
|