@buaa_smat/hometrans 26.0.0-devecocli.3 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +433 -0
- package/agents/build-fixer.md +1 -2
- package/agents/code-reviewer.md +31 -15
- package/agents/model-render-worker.md +9 -5
- package/dist/cli/config-store.js +128 -0
- package/dist/cli/config.js +48 -0
- package/dist/cli/editors.json +114 -0
- package/dist/cli/env-vars.js +127 -0
- package/dist/cli/index.js +73 -0
- package/dist/cli/init.js +2513 -0
- package/dist/cli/uninstall.js +406 -0
- package/dist/platform/compose.js +228 -0
- package/dist/platform/frontmatter.js +151 -0
- package/dist/platform/installer.js +417 -0
- package/dist/platform/registry.js +337 -0
- package/dist/platform/transform.js +363 -0
- package/dist/platform/types.js +9 -0
- package/dist/platform/validate.js +152 -0
- package/dist/utils/regex.js +7 -0
- package/env-requirements.json +511 -0
- package/package.json +240 -11
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
- package/resource/choose_editor.png +0 -0
- package/resource/convert_pipeline_process.svg +114 -0
- package/resource/project_architecture.svg +120 -0
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/resource/set_sdk.png +0 -0
- package/resource/title_dark.png +0 -0
- package/skills/a2h-app-migrate/SKILL.md +17 -11
- package/skills/a2h-app-migrate/references/stage-map.md +22 -7
- package/skills/a2h-app-migrate/references/workflow.yaml +276 -209
- package/skills/a2h-app-migrate/scripts/android_index.mjs +34 -16
- package/skills/a2h-app-migrate/scripts/check_arch_done.mjs +12 -12
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +12 -12
- package/skills/a2h-app-migrate/scripts/check_signing.mjs +16 -16
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +17 -16
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +141 -62
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +12 -12
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +26 -26
- package/skills/a2h-app-migrate/scripts/cli_values.mjs +7 -7
- package/skills/a2h-app-migrate/scripts/ensure_utg_snapshot.mjs +144 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +474 -365
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +115 -108
- package/skills/a2h-app-migrate/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-app-migrate/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +6 -6
- package/skills/a2h-app-migrate/scripts/json_io.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +15 -15
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +99 -99
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +25 -25
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +9 -9
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +33 -33
- package/skills/a2h-app-migrate/scripts/spec_layout.mjs +13 -11
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +128 -80
- package/skills/a2h-app-migrate/scripts/write_resume_summary.mjs +349 -0
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +21 -21
- package/skills/a2h-arch-generate/scripts/create_project.mjs +23 -23
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +48 -40
- package/skills/a2h-arch-generate/scripts/generate_state.mjs +7 -7
- package/skills/a2h-arch-generate/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-arch-generate/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-arch-generate/scripts/inspect_android_project.mjs +10 -1
- package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +41 -36
- package/skills/a2h-arch-generate/scripts/lib/contract_terms.mjs +40 -0
- package/skills/a2h-arch-generate/scripts/lib/py_compat.mjs +1 -1
- package/skills/a2h-arch-generate/scripts/module_create/create.mjs +17 -17
- package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +54 -50
- package/skills/a2h-arch-generate/scripts/scaffold_project.mjs +42 -42
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +69 -44
- package/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +62 -17
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +5 -4
- package/skills/a2h-arkts-logic-coder/SKILL.md +39 -8
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -0
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +28 -17
- package/skills/{a2h-spec-design/SKILL.md → a2h-arkts-logic-coder/references/spec-design.md} +45 -78
- package/skills/a2h-arkts-logic-coder/scripts/check_mvvm.ts +1 -1
- package/skills/a2h-arkts-logic-coder/scripts/check_units.ts +448 -0
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.d.mts +5 -0
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.mjs +54 -0
- package/skills/{a2h-spec-design/scripts → a2h-arkts-logic-coder/scripts/design}/inspect_spec_design_inputs.mjs +18 -12
- package/skills/{a2h-spec-design/scripts → a2h-arkts-logic-coder/scripts/design}/lib/py_compat.mjs +1 -1
- package/skills/{a2h-spec-design/scripts → a2h-arkts-logic-coder/scripts/design}/move_spec_technical_reference.mjs +10 -7
- package/skills/{a2h-spec-design/scripts → a2h-arkts-logic-coder/scripts/design}/resolve_module_design.mjs +13 -7
- package/skills/{a2h-spec-design/scripts → a2h-arkts-logic-coder/scripts/design}/validate_spec_design_output.mjs +57 -41
- package/skills/a2h-arkts-logic-coder/scripts/stop_check_hook.ts +66 -323
- package/skills/a2h-arkts-logic-coder/scripts/test_check_scripts.ts +66 -108
- package/skills/a2h-arkts-logic-coder/scripts/test_check_units.ts +149 -0
- package/skills/a2h-arkts-logic-coder/scripts/test_worktree_compat.ts +5 -18
- package/skills/a2h-batch-ui-align/SKILL.md +39 -39
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +31 -0
- package/skills/a2h-batch-ui-align/references/cards/build.md +13 -0
- package/skills/a2h-batch-ui-align/references/cards/canvas.md +17 -0
- package/skills/a2h-batch-ui-align/references/cards/dynamics.md +27 -0
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +80 -0
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +22 -0
- package/skills/a2h-batch-ui-align/references/cards/resources.md +83 -0
- package/skills/a2h-batch-ui-align/references/cards/state-v1.md +29 -0
- package/skills/a2h-batch-ui-align/references/cards/state.md +14 -0
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +38 -0
- package/skills/a2h-batch-ui-align/references/cards/window.md +29 -0
- package/skills/a2h-batch-ui-align/references/checker-rules.md +642 -0
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +69 -260
- package/skills/a2h-batch-ui-align/references/host-dispatch.md +34 -0
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +16 -4
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +3 -1
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +32 -1
- package/skills/a2h-batch-ui-align/references/source-only-tier.md +7 -1
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +28 -0
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +220 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +11 -9
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +13 -8
- package/skills/a2h-batch-ui-align/references/step5-convert.md +21 -18
- package/skills/a2h-batch-ui-align/scripts/agent_cli.mjs +44 -44
- package/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +237 -236
- package/skills/a2h-batch-ui-align/scripts/arkts_static_check.ts +42 -3834
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +34 -32
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +1 -1
- package/skills/a2h-batch-ui-align/scripts/detect_paradigm.mjs +240 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +139 -33
- package/skills/a2h-batch-ui-align/scripts/gen_rule_docs.mjs +100 -0
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +26 -25
- package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +1 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +159 -12
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +145 -21
- package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +8 -8
- package/skills/a2h-batch-ui-align/scripts/host_env.mjs +1 -1
- package/skills/a2h-batch-ui-align/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-batch-ui-align/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-batch-ui-align/scripts/image_probe.mjs +228 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +444 -266
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +66 -32
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +141 -57
- package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +410 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +80 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/cli.ts +134 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/findings.ts +21 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +22 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/meta.ts +34 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +668 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +392 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +167 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/package.json +3 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +101 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +629 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +125 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +67 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/block_comment_break.ts +64 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +134 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_call_sites.ts +242 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +71 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/canvas.ts +255 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +102 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/column_shrink.ts +154 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +39 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/container_align.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_root_builtin.ts +69 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_route.ts +114 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/fixed_size_safe_area.ts +103 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/format_string.ts +157 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +115 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +551 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +138 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +310 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/offset_in_scroll.ts +163 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/orphan_component.ts +119 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/page_reachability.ts +94 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/path_commands_vp.ts +50 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +80 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +64 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/r_template_string.ts +37 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/request_permission.ts +98 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/resource_as_string.ts +68 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +97 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/safe_area_clipping.ts +168 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sdk_api.ts +195 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/shared_chrome.ts +73 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_blur.ts +95 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/shell_content.ts +198 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/stack_occluding.ts +118 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/state_decorators.ts +73 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/state_name_shadows.ts +93 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/string_quote_leak.ts +73 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/surface_stroke.ts +50 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/track_getter.ts +132 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +53 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +68 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +153 -0
- package/skills/a2h-batch-ui-align/scripts/text_color_diff.mjs +65 -65
- package/skills/a2h-coldstart-smoke-gate/SKILL.md +8 -6
- package/skills/a2h-dashboard-render/SKILL.md +15 -7
- package/skills/a2h-dashboard-render/references/artifact-contract.jsonc +5 -35
- package/skills/a2h-dashboard-render/references/artifact-registry-spec.md +4 -4
- package/skills/a2h-dashboard-render/references/dashboard-guide.md +91 -0
- package/skills/a2h-dashboard-render/scripts/check-registry.mjs +17 -17
- package/skills/a2h-dashboard-render/scripts/dashboard.css +3546 -0
- package/skills/a2h-dashboard-render/scripts/dashboard.mjs +1021 -941
- package/skills/a2h-dashboard-render/scripts/device_capture.mjs +104 -65
- package/skills/a2h-dashboard-render/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-dashboard-render/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-dashboard-render/scripts/page_capture.mjs +8 -8
- package/skills/a2h-dashboard-render/scripts/usage_readers.mjs +67 -37
- package/skills/a2h-dashboard-render/scripts/usage_worker.mjs +4 -4
- package/skills/a2h-fix-build-errors/SKILL.md +1 -2
- package/skills/a2h-resource-convert/SKILL.md +1 -3
- package/skills/a2h-resource-convert/references/step7-report-template.md +2 -2
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +366 -361
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +170 -170
- package/skills/a2h-resource-convert/scripts/app_identity.ts +162 -162
- package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +95 -95
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +132 -132
- package/skills/a2h-resource-convert/scripts/extract_project_resources.ts +220 -220
- package/skills/a2h-resource-convert/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-resource-convert/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +74 -74
- package/skills/a2h-spec-design-pipeline/SKILL.md +113 -63
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +226 -56
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +315 -62
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +4 -2
- package/skills/a2h-spec-design-pipeline/references/initialization.md +12 -9
- package/skills/a2h-spec-design-pipeline/references/legacy-cleanup.md +18 -0
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +109 -8
- package/skills/a2h-spec-design-pipeline/references/scripts.md +29 -16
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +116 -8
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +179 -0
- package/skills/a2h-spec-design-pipeline/scripts/audit_claims.ts +33 -5
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +36 -16
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +93 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +915 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/ledger.mjs +234 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/plan.mjs +33 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +31 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +94 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/state-mirror.mjs +55 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/timeouts.mjs +34 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +92 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/waker.mjs +60 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/worktree.mjs +89 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +551 -0
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +267 -33
- package/skills/a2h-spec-design-pipeline/scripts/git_baseline.ts +30 -10
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +634 -0
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/io.mjs +33 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +107 -19
- package/skills/a2h-spec-design-pipeline/scripts/stage_design_inputs.ts +79 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_atomic_write.ts +4 -4
- package/skills/a2h-spec-design-pipeline/scripts/test_audit_claims.ts +121 -38
- package/skills/a2h-spec-design-pipeline/scripts/test_branch_landed.ts +58 -11
- package/skills/a2h-spec-design-pipeline/scripts/test_deps_ready.ts +31 -31
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +564 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +339 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +161 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +1024 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_ledger.mjs +178 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_plan.mjs +60 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +58 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +91 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +60 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_waker.mjs +95 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_worktree.mjs +81 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +183 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_git_baseline.ts +29 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +294 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_i18n_term.ts +70 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +157 -30
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_waves.ts +2 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_stage_design_inputs.ts +72 -0
- package/skills/a2h-spec-generate/SKILL.md +34 -10
- package/skills/a2h-spec-generate/references/batch-mode.md +4 -1
- package/skills/a2h-spec-generate/references/fusion-task-contract.md +90 -21
- package/skills/a2h-spec-generate/references/recall-guide.md +1 -0
- package/skills/a2h-spec-generate/references/requirement-scope.md +1 -1
- package/skills/a2h-spec-generate/references/specs.schema.json +6 -0
- package/skills/a2h-spec-generate/references/worker-rules.md +2 -1
- package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +305 -116
- package/skills/a2h-spec-generate/scripts/check_spec.ts +136 -114
- package/skills/a2h-spec-generate/scripts/collect-specs.mjs +19 -4
- package/skills/a2h-spec-generate/scripts/ensure-index.mjs +74 -14
- package/skills/a2h-spec-generate/scripts/feature-stem.mjs +4 -2
- package/skills/a2h-spec-generate/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-spec-generate/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-spec-generate/scripts/parse_requirements.ts +65 -65
- package/skills/a2h-spec-generate/scripts/prepare-facts.mjs +8 -2
- package/skills/a2h-spec-generate/scripts/publication-verdict.mjs +8 -2
- package/skills/a2h-spec-generate/scripts/publish-specs.mjs +80 -5
- package/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +670 -0
- package/skills/a2h-spec-generate/scripts/render-tasks.mjs +37 -30
- package/skills/a2h-spec-generate/scripts/report.mjs +7 -3
- package/skills/a2h-spec-generate/scripts/reqgen/assets/dashboard.html +26 -26
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-api.js +2 -2
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-code-view.js +2 -2
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-format.js +4 -4
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-handoff.js +6 -6
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-tree.js +3 -3
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.html +23 -23
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.js +16 -16
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +27 -26
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +7 -4
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +32 -31
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +3 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +26 -20
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +92 -69
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-output.ts +7 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +545 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +545 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +177 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +424 -29
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +133 -7
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +302 -103
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/zip.ts +99 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.d.mts +5 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.mjs +54 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +8 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/schema.ts +5 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +39 -33
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +4 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +4 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +48 -6
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +366 -5
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/query.ts +102 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +81 -52
- package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +21 -11
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +2 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +13 -4
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-api.ts +2 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-code-view.ts +2 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-format.ts +4 -4
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-handoff.ts +6 -6
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-tree.ts +3 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz.ts +16 -16
- package/skills/a2h-utg-explorer/assets/final_viewer.html +21 -21
- package/skills/a2h-utg-explorer/references/architecture.md +7 -2
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +108 -9
- package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +21 -3
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +4 -1
- package/skills/a2h-utg-explorer/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-utg-explorer/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +229 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +45 -2
- package/skills/a2h-utg-explorer/scripts/recover_b.mjs +2 -1
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +17 -6
- package/skills/a2h-utg-explorer/scripts/report.mjs +38 -18
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +16 -6
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +179 -18
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +21 -4
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +454 -43
- package/skills/a2h-utg-static/SKILL.md +7 -0
- package/skills/a2h-utg-static/scripts/assemble.mjs +29 -2
- package/skills/a2h-utg-static/scripts/click_paths.mjs +42 -26
- package/skills/a2h-utg-static/scripts/compose_body_text.mjs +6 -0
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +4 -2
- package/skills/a2h-utg-static/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-utg-static/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-utg-static/scripts/manifest.mjs +91 -10
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +68 -3
- package/skills/a2h-utg-static/scripts/presenter_nav.mjs +2 -1
- package/skills/a2h-utg-static/scripts/route_interceptor.mjs +374 -0
- package/skills/a2h-utg-static/scripts/static_prior.mjs +87 -33
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +240 -8
- package/skills/a2h-utg-static/scripts/utg_html.mjs +51 -51
- package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +100 -100
- package/devecocli-plugin/common.ts +0 -2203
- package/devecocli-plugin/install.ts +0 -61
- package/devecocli-plugin/uninstall.ts +0 -26
- package/devecocli-plugin/update.ts +0 -66
- package/index.js +0 -1418
- package/plugin.jsonc +0 -12
- package/skills/a2h-app-migrate/test/test_android_index.mjs +0 -80
- package/skills/a2h-app-migrate/test/test_apk_preflight.mjs +0 -63
- package/skills/a2h-app-migrate/test/test_arch_done.mjs +0 -54
- package/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +0 -92
- package/skills/a2h-app-migrate/test/test_config_example.mjs +0 -42
- package/skills/a2h-app-migrate/test/test_entry_guards.mjs +0 -93
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +0 -544
- package/skills/a2h-app-migrate/test/test_finalize.mjs +0 -89
- package/skills/a2h-app-migrate/test/test_gate_checkpoint.mjs +0 -146
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +0 -68
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +0 -91
- package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -122
- package/skills/a2h-app-migrate/test/test_json_io.mjs +0 -32
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +0 -109
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +0 -53
- package/skills/a2h-app-migrate/test/test_parse_args.mjs +0 -69
- package/skills/a2h-app-migrate/test/test_preflight_report.mjs +0 -93
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +0 -144
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +0 -100
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +0 -315
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +0 -133
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +0 -133
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +0 -158
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +0 -181
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +0 -76
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +0 -53
- package/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +0 -226
- package/skills/a2h-app-migrate/test/test_uniapp_preflight.mjs +0 -83
- package/skills/a2h-app-migrate/test/test_utg_dirs.mjs +0 -39
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +0 -168
- package/skills/a2h-app-migrate/test/test_validate_races.mjs +0 -50
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/build.gradle +0 -11
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/AndroidManifest.xml +0 -12
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/MainActivity.kt +0 -8
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/NotesStore.kt +0 -17
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/build.gradle +0 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/settings.gradle +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/AppScope/app.json5 +0 -8
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/build-profile.json5 +0 -14
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/build-profile.json5 +0 -7
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/oh-package.json5 +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/src/main/ets/utils/Format.ets +0 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/build-profile.json5 +0 -7
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/oh-package.json5 +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/src/main/ets/pages/Home.ets +0 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/build-profile.json5 +0 -7
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/oh-package.json5 +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/src/main/ets/engine/SyncEngine.ets +0 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/hvigorfile.ts +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/oh-package.json5 +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/build-profile.json5 +0 -7
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/oh-package.json5 +0 -9
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/src/main/ets/pages/Index.ets +0 -7
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/App.vue +0 -10
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/manifest.json +0 -6
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages/index/index.vue +0 -16
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +0 -5
- package/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +0 -548
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +0 -1122
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +0 -191
- package/skills/a2h-arch-generate/scripts/tests/test_console_encoding.mjs +0 -52
- package/skills/a2h-arch-generate/scripts/tests/test_git_root.mjs +0 -34
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +0 -138
- package/skills/a2h-arkts-logic-coder/scripts/check_module_scope.ts +0 -224
- package/skills/a2h-batch-ui-align/flowchart.html +0 -271
- package/skills/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 -648
- package/skills/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 -2089
- package/skills/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 -1033
- package/skills/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 -1183
- package/skills/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 -576
- package/skills/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 -297
- package/skills/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 -395
- package/skills/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 -903
- package/skills/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 -106
- package/skills/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 -1178
- package/skills/a2h-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +0 -911
- package/skills/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 -355
- package/skills/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 -11
- package/skills/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 -206
- package/skills/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 -373
- package/skills/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 -158
- package/skills/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 -750
- package/skills/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 -1704
- package/skills/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 -1012
- package/skills/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 -164
- package/skills/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 -840
- package/skills/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 -856
- package/skills/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 -83
- package/skills/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 -294
- package/skills/a2h-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +0 -1407
- package/skills/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 -1220
- package/skills/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 -47
- package/skills/a2h-batch-ui-align/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +0 -133
- package/skills/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 -840
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +0 -217
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_align_tint.test.mjs +0 -253
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_canvas_pct.test.mjs +0 -312
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +0 -241
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +0 -341
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +0 -298
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +0 -365
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_shell.test.mjs +0 -91
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +0 -445
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +0 -356
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +0 -290
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +0 -74
- package/skills/a2h-batch-ui-align/scripts/tests/export_scroll_states.test.mjs +0 -31
- package/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +0 -564
- package/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +0 -123
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +0 -126
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +0 -241
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +0 -1451
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +0 -215
- package/skills/a2h-batch-ui-align/scripts/tests/harmony_index.test.mjs +0 -95
- package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +0 -115
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +0 -170
- package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +0 -102
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +0 -244
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +0 -166
- package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +0 -49
- package/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +0 -219
- package/skills/a2h-dashboard-render/references//347/234/213/346/235/277/350/257/264/346/230/216.md +0 -83
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/broken.xml +0 -1
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +0 -156
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +0 -1
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +0 -1
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/nested_scroll.xml +0 -1
- package/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +0 -170
- package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +0 -99
- package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +0 -182
- package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +0 -64
- package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +0 -1172
- package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +0 -251
- package/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +0 -81
- package/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +0 -115
- package/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +0 -303
- package/skills/a2h-dashboard-render/test/test_page_capture.mjs +0 -147
- package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +0 -444
- package/skills/a2h-module-semantic-docs/test/golden/module_structure.json +0 -187
- package/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +0 -351
- package/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +0 -495
- package/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +0 -157
- package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +0 -388
- package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +0 -182
- package/skills/a2h-resource-convert/scripts/tests/app_identity.test.mjs +0 -206
- package/skills/a2h-spec-design/test/golden/inspect_happy.json +0 -20
- package/skills/a2h-spec-design/test/golden/move_design.md +0 -18
- package/skills/a2h-spec-design/test/golden/move_design_crlf.md +0 -18
- package/skills/a2h-spec-design/test/golden/move_spec.md +0 -7
- package/skills/a2h-spec-design/test/golden/resolve_cases.json +0 -36
- package/skills/a2h-spec-design/test/golden/validate_issue_file.md +0 -12
- package/skills/a2h-spec-design/test/golden/validate_issues.json +0 -57
- package/skills/a2h-spec-design/test/test_spec_design_scripts.mjs +0 -381
- package/skills/a2h-spec-design-pipeline/scripts/inflight.mjs +0 -944
- package/skills/a2h-spec-design-pipeline/scripts/lib/bgcli.mjs +0 -95
- package/skills/a2h-spec-design-pipeline/scripts/reconcile.mjs +0 -218
- package/skills/a2h-spec-design-pipeline/scripts/test_bgcli.mjs +0 -64
- package/skills/a2h-spec-design-pipeline/scripts/test_inflight.mjs +0 -452
- package/skills/a2h-spec-design-pipeline/scripts/test_reconcile.mjs +0 -182
- package/skills/a2h-spec-design-pipeline/scripts/test_watchdog.mjs +0 -289
- package/skills/a2h-spec-design-pipeline/scripts/watchdog.mjs +0 -441
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-fact-join.test.ts +0 -50
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-name-uniapp.test.ts +0 -75
- package/skills/a2h-spec-generate/scripts/reqgen/test/cross-area-anchor.test.ts +0 -256
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +0 -576
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +0 -290
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +0 -1323
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +0 -574
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +0 -339
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +0 -831
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +0 -548
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-cli-blockers.test.ts +0 -117
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +0 -396
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-seeds.test.ts +0 -175
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +0 -298
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +0 -1061
- package/skills/a2h-spec-generate/scripts/reqgen/test/specgen-completeness.test.ts +0 -286
- package/skills/a2h-spec-generate/scripts/reqgen/test/stagem-stored-path.test.ts +0 -25
- package/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +0 -159
- package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +0 -632
- package/skills/a2h-spec-generate/test/check-spec.test.ts +0 -200
- package/skills/a2h-spec-generate/test/collect-specs.test.mjs +0 -538
- package/skills/a2h-spec-generate/test/detect-project.test.mjs +0 -37
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +0 -45
- package/skills/a2h-spec-generate/test/feature-stem.test.mjs +0 -147
- package/skills/a2h-spec-generate/test/fixtures/android/app/src/main/AndroidManifest.xml +0 -3
- package/skills/a2h-spec-generate/test/fixtures/android/build.gradle +0 -3
- package/skills/a2h-spec-generate/test/fixtures/android/settings.gradle +0 -3
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/package.json +0 -9
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/App.vue +0 -8
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +0 -9
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +0 -1
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/main.ts +0 -6
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/manifest.json +0 -4
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +0 -1
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +0 -33
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +0 -1
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +0 -23
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/services/items.ts +0 -3
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/tsconfig.json +0 -8
- package/skills/a2h-spec-generate/test/fixtures/unknown/README.txt +0 -1
- package/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +0 -54
- package/skills/a2h-spec-generate/test/publication-verdict.test.mjs +0 -157
- package/skills/a2h-spec-generate/test/publish-specs.test.mjs +0 -282
- package/skills/a2h-spec-generate/test/render-tasks.test.mjs +0 -593
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +0 -66
- package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +0 -45
- package/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +0 -243
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +0 -104
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +0 -223
- package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +0 -88
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +0 -187
- package/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +0 -130
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +0 -136
- package/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +0 -135
- package/skills/a2h-utg-explorer/scripts/tests/first_round_phases.test.mjs +0 -16
- package/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +0 -251
- package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +0 -42
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +0 -162
- package/skills/a2h-utg-explorer/scripts/tests/node_coverage.test.mjs +0 -193
- package/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +0 -204
- package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +0 -355
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +0 -240
- package/skills/a2h-utg-explorer/scripts/tests/recover.test.mjs +0 -212
- package/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +0 -173
- package/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +0 -267
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +0 -213
- package/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +0 -345
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +0 -453
- package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +0 -131
- package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +0 -229
- package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +0 -336
- package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +0 -102
- package/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +0 -92
- package/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +0 -119
- package/skills/a2h-utg-explorer/scripts/tests/u2_backend.test.mjs +0 -346
- package/skills/a2h-utg-explorer/scripts/tests/ui_state_anchors.test.mjs +0 -112
- package/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +0 -63
- package/skills/a2h-utg-explorer/scripts/tests/worklist_parts.test.mjs +0 -24
- package/skills/a2h-utg-static/scripts/tests/_zipw.mjs +0 -28
- package/skills/a2h-utg-static/scripts/tests/probe_autoload.mjs +0 -108
- package/skills/a2h-utg-static/scripts/tests/probe_layout_fragments.mjs +0 -90
- package/skills/a2h-utg-static/scripts/tests/probe_unknown_scope.mjs +0 -61
- package/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +0 -1261
- package/skills/a2h-utg-static/scripts/tests/test_activity_alias_launcher.mjs +0 -90
- package/skills/a2h-utg-static/scripts/tests/test_activity_supertype_chain.mjs +0 -106
- package/skills/a2h-utg-static/scripts/tests/test_bottom_sheet_container.mjs +0 -58
- package/skills/a2h-utg-static/scripts/tests/test_branch_guard.mjs +0 -19
- package/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +0 -30
- package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +0 -103
- package/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +0 -60
- package/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +0 -111
- package/skills/a2h-utg-static/scripts/tests/test_commit_scope.mjs +0 -113
- package/skills/a2h-utg-static/scripts/tests/test_compose_file_private_route.mjs +0 -117
- package/skills/a2h-utg-static/scripts/tests/test_compose_nested_graph.mjs +0 -166
- package/skills/a2h-utg-static/scripts/tests/test_compose_route_holder_collision.mjs +0 -112
- package/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +0 -284
- package/skills/a2h-utg-static/scripts/tests/test_custom_source_root.mjs +0 -71
- package/skills/a2h-utg-static/scripts/tests/test_defensive_null_guard.mjs +0 -77
- package/skills/a2h-utg-static/scripts/tests/test_dialog_orphan_entries.mjs +0 -99
- package/skills/a2h-utg-static/scripts/tests/test_dialog_page_owner.mjs +0 -69
- package/skills/a2h-utg-static/scripts/tests/test_dialogshow_builder_forms.mjs +0 -96
- package/skills/a2h-utg-static/scripts/tests/test_dialogshow_java_factory.mjs +0 -37
- package/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +0 -42
- package/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +0 -140
- package/skills/a2h-utg-static/scripts/tests/test_edge_dedupe_by_gesture.mjs +0 -111
- package/skills/a2h-utg-static/scripts/tests/test_edge_provenance_lint.mjs +0 -70
- package/skills/a2h-utg-static/scripts/tests/test_enclosing_gesture.mjs +0 -69
- package/skills/a2h-utg-static/scripts/tests/test_external_surface_roots.mjs +0 -43
- package/skills/a2h-utg-static/scripts/tests/test_find_package_indirect.mjs +0 -67
- package/skills/a2h-utg-static/scripts/tests/test_forwarding_wrapper.mjs +0 -38
- package/skills/a2h-utg-static/scripts/tests/test_fragment_containment.mjs +0 -85
- package/skills/a2h-utg-static/scripts/tests/test_fragment_helper_trigger.mjs +0 -92
- package/skills/a2h-utg-static/scripts/tests/test_graph.mjs +0 -55
- package/skills/a2h-utg-static/scripts/tests/test_guard_clause.mjs +0 -86
- package/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +0 -119
- package/skills/a2h-utg-static/scripts/tests/test_host_kind_by_chain.mjs +0 -68
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +0 -74
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +0 -181
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +0 -293
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +0 -118
- package/skills/a2h-utg-static/scripts/tests/test_interaction_sites.mjs +0 -272
- package/skills/a2h-utg-static/scripts/tests/test_item_data_instance.mjs +0 -51
- package/skills/a2h-utg-static/scripts/tests/test_kotlin_fn_spans.mjs +0 -69
- package/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +0 -187
- package/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +0 -70
- package/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +0 -67
- package/skills/a2h-utg-static/scripts/tests/test_layout_declared_fragment.mjs +0 -103
- package/skills/a2h-utg-static/scripts/tests/test_listener_call_forms.mjs +0 -79
- package/skills/a2h-utg-static/scripts/tests/test_listener_receiver_binding.mjs +0 -47
- package/skills/a2h-utg-static/scripts/tests/test_manifest_exported_default.mjs +0 -40
- package/skills/a2h-utg-static/scripts/tests/test_manifest_filters_modules.mjs +0 -84
- package/skills/a2h-utg-static/scripts/tests/test_manifest_srcfile.mjs +0 -68
- package/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +0 -172
- package/skills/a2h-utg-static/scripts/tests/test_module_namespace.mjs +0 -33
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +0 -44
- package/skills/a2h-utg-static/scripts/tests/test_multiple_entry_contracts.mjs +0 -80
- package/skills/a2h-utg-static/scripts/tests/test_nav_graph_xml.mjs +0 -35
- package/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +0 -42
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +0 -85
- package/skills/a2h-utg-static/scripts/tests/test_node_id_collision.mjs +0 -57
- package/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +0 -62
- package/skills/a2h-utg-static/scripts/tests/test_out_of_scope_and_settings.mjs +0 -72
- package/skills/a2h-utg-static/scripts/tests/test_overload_and_climb.mjs +0 -86
- package/skills/a2h-utg-static/scripts/tests/test_pager_page_source.mjs +0 -78
- package/skills/a2h-utg-static/scripts/tests/test_pager_position_zero.mjs +0 -65
- package/skills/a2h-utg-static/scripts/tests/test_pager_variant_guard.mjs +0 -172
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +0 -107
- package/skills/a2h-utg-static/scripts/tests/test_plain_dialog_nodes.mjs +0 -167
- package/skills/a2h-utg-static/scripts/tests/test_plaindialog_shared_anchor.mjs +0 -117
- package/skills/a2h-utg-static/scripts/tests/test_preference_click_nav.mjs +0 -98
- package/skills/a2h-utg-static/scripts/tests/test_preference_host_binding.mjs +0 -87
- package/skills/a2h-utg-static/scripts/tests/test_preference_nesting.mjs +0 -183
- package/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +0 -48
- package/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +0 -41
- package/skills/a2h-utg-static/scripts/tests/test_resolver_tier_parity.mjs +0 -126
- package/skills/a2h-utg-static/scripts/tests/test_result_launcher.mjs +0 -142
- package/skills/a2h-utg-static/scripts/tests/test_review_fixes.mjs +0 -135
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +0 -66
- package/skills/a2h-utg-static/scripts/tests/test_same_name_decl_scope.mjs +0 -236
- package/skills/a2h-utg-static/scripts/tests/test_scope_utils.mjs +0 -85
- package/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +0 -148
- package/skills/a2h-utg-static/scripts/tests/test_shared_overlay_split.mjs +0 -63
- package/skills/a2h-utg-static/scripts/tests/test_slug_parity.mjs +0 -58
- package/skills/a2h-utg-static/scripts/tests/test_starter_node_id.mjs +0 -41
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_arity.mjs +0 -109
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_commented_candidates.mjs +0 -68
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_model_gates.mjs +0 -127
- package/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +0 -130
- package/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +0 -51
- package/skills/a2h-utg-static/scripts/tests/test_template_method_layout.mjs +0 -81
- package/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +0 -58
- package/skills/a2h-utg-static/scripts/tests/test_trigger_id_spelling.mjs +0 -68
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_action_override.mjs +0 -91
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +0 -110
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_nl_hint_key.mjs +0 -89
- package/skills/a2h-utg-static/scripts/tests/test_uiless_host_fold.mjs +0 -98
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +0 -231
- package/skills/a2h-utg-static/scripts/tests/test_view_click_refs.mjs +0 -104
- package/skills/a2h-utg-static/scripts/tests/test_view_id_label.mjs +0 -69
- package/skills/a2h-utg-static/scripts/tests/test_view_interactions.mjs +0 -346
- package/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +0 -340
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +0 -98
- package/skills/a2h-utg-static/scripts/tests/test_widget_class_scope.mjs +0 -92
- package/skills/a2h-utg-static/scripts/tests/test_window_nav_kotlin.mjs +0 -158
- package/skills/a2h-utg-static/scripts/tests/test_worklist_parts.mjs +0 -65
|
@@ -35,9 +35,9 @@ import {
|
|
|
35
35
|
} from './_py.mjs';
|
|
36
36
|
import { deviceLockPath, LOCK_GRACE_S, holderGone, myStartMs } from './device_lock.mjs';
|
|
37
37
|
import {
|
|
38
|
-
DeviceAdapter, AdapterError, atomicWriteJson, event, readJson, matching, observationKey, ruleMatches,
|
|
38
|
+
DeviceAdapter, AdapterError, atomicWriteJson, event, readJson, matching, observationKey, ruleMatches, tarProblem,
|
|
39
39
|
} from './adapters.mjs';
|
|
40
|
-
import { applyStateAnchors, observationMatchesStatic, resolvePage, occludedIndices, resolveTwinByOpener, backCanReach, uiStatesOf } from './semantics.mjs';
|
|
40
|
+
import { applyStateAnchors, observationMatchesStatic, resolvePage, occludedIndices, resolveTwinByOpener, backCanReach, uiStatesOf, normalized, isInputNode } from './semantics.mjs';
|
|
41
41
|
import { coverageMode, coveredStaticIds, scopeOf } from './coverage.mjs';
|
|
42
42
|
import { triggerAttests } from './attest.mjs';
|
|
43
43
|
|
|
@@ -179,11 +179,85 @@ export function _viewSig(observation) {
|
|
|
179
179
|
/** Device-side outages (retried after the device answers again), not app failures. */
|
|
180
180
|
const DEVICE_UNAVAILABLE = 'device-unavailable';
|
|
181
181
|
|
|
182
|
+
/**
|
|
183
|
+
* launchMismatch(msg, launchComponent): a block reason when `am start` could not find a class with
|
|
184
|
+
* the configured launcher's simple name but a different FQN, else null. The caller asks only for a
|
|
185
|
+
* task whose source_launch is the static launcher (`launcher`, compile_tasks launchAction). That is the static UTG
|
|
186
|
+
* resolving `.MainActivity` against the applicationId instead of the namespace (applicationIdSuffix
|
|
187
|
+
* ".debug" etc.): every source launch then fails, and skipping each task as
|
|
188
|
+
* entry-component-not-installed ended a round with nothing captured and no stated cause.
|
|
189
|
+
*/
|
|
190
|
+
export function launchMismatch(msg, launchComponent) {
|
|
191
|
+
const m = /Activity class \{([^}]+)\}/.exec(pyStr(msg));
|
|
192
|
+
const cfg = pyStr(launchComponent ?? '');
|
|
193
|
+
if (!m || !cfg.includes('/')) { return null; }
|
|
194
|
+
const tried = m[1];
|
|
195
|
+
const cls = (c) => { const [pk, name] = c.split('/'); return name.startsWith('.') ? pk + name : name; };
|
|
196
|
+
const a = cls(tried); const b = cls(cfg);
|
|
197
|
+
if (a === b || a.split('.').pop() !== b.split('.').pop()) { return null; }
|
|
198
|
+
return `launch-component-mismatch: ${tried} is not installed but config.launch_component is ${cfg}; `
|
|
199
|
+
+ 'the static UTG resolved the activity against the applicationId, re-run a2h-utg-static';
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* grantRuntimePermissions(device, config): `pm grant` the app's not-yet-granted runtime permissions
|
|
204
|
+
* unless `grant_runtime_permissions` is false. Shared by Runner and d_prereqs snapshot, which both
|
|
205
|
+
* `pm clear` (that revokes every grant) before a launch. Returns [granted, failed].
|
|
206
|
+
*/
|
|
207
|
+
export function grantRuntimePermissions(device, config) {
|
|
208
|
+
const pkg = get(config, 'package');
|
|
209
|
+
const granted = []; const failed = [];
|
|
210
|
+
if (!truthy(pkg) || !truthy(get(config, 'grant_runtime_permissions', true))) { return [granted, failed]; }
|
|
211
|
+
let dump = '';
|
|
212
|
+
try { dump = device._shell('dumpsys', 'package', pkg); } catch { dump = ''; }
|
|
213
|
+
for (const perm of runtimePermissions(dump, { ungrantedOnly: true })) {
|
|
214
|
+
try { device._shell('pm', 'grant', pkg, perm); granted.push(perm); } catch { failed.push(perm); }
|
|
215
|
+
}
|
|
216
|
+
return [granted, failed];
|
|
217
|
+
}
|
|
218
|
+
|
|
182
219
|
export const TRANSIENT_DEVICE_RE = new RegExp(
|
|
183
220
|
"Can't find service|Cannot identify foreground window|device '[^']+' not found|"
|
|
184
221
|
+ 'device offline|error: closed|device-timeout|ui-dump-(?:failed|remote-missing)|Foreground changed during capture');
|
|
185
222
|
|
|
186
223
|
const isVisible = (n) => truthy(get(n, 'visible', true));
|
|
224
|
+
/** A consent CheckBox's own label (「我已阅读并同意」), as against an optional one (「接收推送」). */
|
|
225
|
+
const CONSENT_BOX_RE = /同意|已阅读|agree|accept/i;
|
|
226
|
+
/**
|
|
227
|
+
* A consent dialog's own positive control when it is not android:id/button1 (a custom layout):
|
|
228
|
+
* the whole label is an accept (「同意」「同意并继续」「我同意」「接受」, "Agree", "I agree",
|
|
229
|
+
* "Accept & continue"). Anchored, so 「不同意」 / "Disagree" / 「我已阅读并同意」 never match.
|
|
230
|
+
*/
|
|
231
|
+
const CONSENT_POSITIVE_RE = /^(?:我)?(?:同意|接受)(?:并(?:继续|使用|进入|开始使用))?$|^(?:i )?(?:agree|accept)(?:(?: and| &) (?:continue|proceed))?$/i;
|
|
232
|
+
/** A label that declines or leaves: an app may put that on button1, so its id alone does not make it the accept. */
|
|
233
|
+
const CONSENT_DECLINE_RE = /不同意|拒绝|退出|取消|暂不|disagree|decline|reject|refuse|exit|quit|cancel|not now/i;
|
|
234
|
+
/** A toggle (CheckBox, Switch, ...): pressing it ticks, it does not accept, even when its label is 「同意」. */
|
|
235
|
+
const isToggle = (n) => [true, 'true'].includes(get(n, 'checkable'))
|
|
236
|
+
|| /(?:CheckBox|Switch|RadioButton|ToggleButton|CheckedTextView)$/.test(pyStr(get(n, 'class', '')));
|
|
237
|
+
/** Adapter containers: a text inside one is a bound row (user or app data), not a layout default. */
|
|
238
|
+
export const LIST_CLASS_RE = /(?:RecyclerView|ListView|GridView|WebView)$/;
|
|
239
|
+
/** A layout default is a short label; a longer text holding a specifier is content (a note, a log line). */
|
|
240
|
+
export const PLACEHOLDER_MAX_CHARS = 40;
|
|
241
|
+
/** A consent dialog's text (Runner.consentAccept): privacy policy / user agreement / terms. */
|
|
242
|
+
export const CONSENT_RE = /隐私政策|隐私协议|隐私保护|个人信息保护|用户协议|服务协议|privacy policy|terms of (?:service|use)|user agreement/i;
|
|
243
|
+
/**
|
|
244
|
+
* A text the app has not formatted yet: a java.util.Formatter / Android string-resource
|
|
245
|
+
* specifier left as-is (`%1$s`, `%2$d`, `%.1f`, a bare `%s` / `%d`). It is the layout's
|
|
246
|
+
* android:text default, shown until the data arrives and the code calls getString(id, args)
|
|
247
|
+
* (WeatherApp MainFragment 2026-11-04: `Feels like %1$s`, `%1$d km/h` under Chinatown/20°
|
|
248
|
+
* for ~8 s after every launch; the tree did not change while waiting, so settle() took it as
|
|
249
|
+
* settled and the export made that frame the page's screenshot). `50%` / `13% chance` are not
|
|
250
|
+
* specifiers: a conversion letter must follow. A bare one (`%s`, `%02d`, `%,d`, `%tY`) must not
|
|
251
|
+
* touch an ASCII letter or digit (`5%d`, `x%sy`, a URL's `%20`); CJK around it is fine (`体感%s`).
|
|
252
|
+
*/
|
|
253
|
+
export const UNFORMATTED_TEXT = /%\d+\$[-#+0,(]*\d*(?:\.\d+)?(?:[bBhHsScCdoxXeEfgGaA]|[tT][A-Za-z])|(?<![A-Za-z0-9])%[-#+0,(]*\d*(?:\.\d+)?(?:[sSdfxX]|[tT][A-Za-z])(?![A-Za-z0-9])/;
|
|
254
|
+
export const unformattedText = (t) => typeof t === 'string' && UNFORMATTED_TEXT.test(t);
|
|
255
|
+
/**
|
|
256
|
+
* Identity of a scroll container found immobile in a search pass: class, id and bounds. Not its
|
|
257
|
+
* `{class, index}` selector: a scroll elsewhere can shift the reading-order index of same-class
|
|
258
|
+
* nodes, while a container that did not move keeps its bounds.
|
|
259
|
+
*/
|
|
260
|
+
const stuckKey = (n) => jsonDumps([get(n, 'class') ?? null, get(n, 'resource_id') ?? null, or(get(n, 'bounds'), null)]);
|
|
187
261
|
/**
|
|
188
262
|
* Selector for scroll container `n` that resolves to it alone in `nodes`: its id, else its class,
|
|
189
263
|
* else its class plus reading-order `index` (a Compose page's one scrollable is an
|
|
@@ -203,6 +277,8 @@ function classIndexSel(n, nodes) {
|
|
|
203
277
|
const idx = sortedBy(same, (m) => { const b = or(get(m, 'bounds'), [0, 0]); return b.slice(0, 2).reverse(); }).indexOf(n);
|
|
204
278
|
return idx >= 0 ? { class: n.class, index: idx } : null;
|
|
205
279
|
}
|
|
280
|
+
/** Atom types that press nothing, so they keep consentAccept's after-launch window open. */
|
|
281
|
+
const PASSIVE_ACTIONS = new Set(['wait', 'scroll']);
|
|
206
282
|
const s200 = (e) => cpSlice(errStr(e), 0, 200);
|
|
207
283
|
const CANDIDATE_KINDS = { click_candidates: 'click', long_click_candidates: 'long_click', double_tap_candidates: 'double_tap' };
|
|
208
284
|
|
|
@@ -389,7 +465,7 @@ export class Runner {
|
|
|
389
465
|
} catch { /* the next capture tells */ }
|
|
390
466
|
}
|
|
391
467
|
this.device._foreground();
|
|
392
|
-
this.capture();
|
|
468
|
+
this.capture({ acceptLoading: true });
|
|
393
469
|
return true;
|
|
394
470
|
}
|
|
395
471
|
} catch { /* retry */ }
|
|
@@ -408,7 +484,63 @@ export class Runner {
|
|
|
408
484
|
return e;
|
|
409
485
|
}
|
|
410
486
|
|
|
411
|
-
|
|
487
|
+
/**
|
|
488
|
+
* A verified capture of a page still loading its content: a visible spinner, or a sparse
|
|
489
|
+
* screen (at most 2 labelled app nodes) that shows at most one of the 3+ fixed texts the page's
|
|
490
|
+
* source renders. A Compose spinner is an unlabelled View whose dump does not change while it
|
|
491
|
+
* spins, so settle() takes it for a settled screen (SelectCity on yd-weather 2026-10-30: only
|
|
492
|
+
* the search hint, the city lists still loading). A spinner is a roughly square ProgressBar; a
|
|
493
|
+
* wide one is a bar showing a value (storage used, download), which stays on a loaded page.
|
|
494
|
+
* A visible text still holding a format specifier (`%1$s`, see UNFORMATTED_TEXT) is the
|
|
495
|
+
* layout default before the data is bound: the page is loading, however full it looks. Only a
|
|
496
|
+
* short label outside any list or WebView counts: a row's text is bound data (a note titled
|
|
497
|
+
* `printf("%d")`, a log line `format: %s`) and a long text is content, not a default. A text
|
|
498
|
+
* an upper layer paints over (the host page under a full-screen fragment) is not this page's.
|
|
499
|
+
* a2h-batch-ui-align export_ui_info.mjs placeholderTexts applies the same test to the export.
|
|
500
|
+
*/
|
|
501
|
+
looksLoading(observation) {
|
|
502
|
+
const resolution = get(observation, 'static_resolution', {});
|
|
503
|
+
if (get(resolution, 'status') !== 'verified') { return false; }
|
|
504
|
+
const pkg = get(this.config, 'package');
|
|
505
|
+
const own = get(observation, 'nodes', []).filter((n) => isVisible(n) && (!truthy(pkg) || get(n, 'package', pkg) === pkg));
|
|
506
|
+
const spinner = (n) => {
|
|
507
|
+
if (!pyStr(get(n, 'class', '')).endsWith('ProgressBar')) { return false; }
|
|
508
|
+
const b = get(n, 'bounds', []);
|
|
509
|
+
if (!Array.isArray(b) || b.length !== 4) { return true; }
|
|
510
|
+
const w = b[2] - b[0]; const h = b[3] - b[1];
|
|
511
|
+
return w > 0 && h > 0 && Math.max(w, h) <= 2 * Math.min(w, h);
|
|
512
|
+
};
|
|
513
|
+
if (own.some(spinner)) { return true; }
|
|
514
|
+
const nodes = get(observation, 'nodes', []);
|
|
515
|
+
const inList = (n) => {
|
|
516
|
+
const seen = new Set();
|
|
517
|
+
for (let i = get(n, 'parent_index'); i !== null && i !== undefined && i >= 0 && i < nodes.length && !seen.has(i); i = get(nodes[i], 'parent_index')) {
|
|
518
|
+
seen.add(i);
|
|
519
|
+
if (LIST_CLASS_RE.test(pyStr(get(nodes[i], 'class', '')))) { return true; }
|
|
520
|
+
}
|
|
521
|
+
return false;
|
|
522
|
+
};
|
|
523
|
+
const placeholder = (n) => {
|
|
524
|
+
const t = get(n, 'text');
|
|
525
|
+
return unformattedText(t) && [...t].length <= PLACEHOLDER_MAX_CHARS && !isInputNode(n) && !inList(n);
|
|
526
|
+
};
|
|
527
|
+
const covered = new Set([...occludedIndices(nodes)].map((i) => nodes[i]));
|
|
528
|
+
if (own.some((n) => !covered.has(n) && placeholder(n))) { return true; }
|
|
529
|
+
const body = get(get(this.catalog, resolution.static_id, {}), 'body_titles', []) || [];
|
|
530
|
+
if (body.length < 3) { return false; }
|
|
531
|
+
const shown = new Set();
|
|
532
|
+
for (const n of own) {
|
|
533
|
+
for (const k of ['text', 'content_desc']) { if (truthy(get(n, k))) { shown.add(normalized(n[k])); } }
|
|
534
|
+
}
|
|
535
|
+
return shown.size <= 2 && body.filter((t) => shown.has(t)).length <= 1;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* capture({ acceptLoading }): observe, resolve and map. A capture that looksLoading is recorded
|
|
540
|
+
* but not mapped (its screenshot would stand for the page), unless `acceptLoading`; atom() waits
|
|
541
|
+
* for the content and maps the loaded capture instead.
|
|
542
|
+
*/
|
|
543
|
+
capture({ acceptLoading = false } = {}) {
|
|
412
544
|
const observation = this.device.observe(this.env);
|
|
413
545
|
const resolution = resolveTwinByOpener(
|
|
414
546
|
deps.resolvePage(observation, this.catalog, get(observation, 'identity'), { app_package: get(this.config, 'package') }),
|
|
@@ -419,13 +551,32 @@ export class Runner {
|
|
|
419
551
|
if (resolution.status === 'verified') {
|
|
420
552
|
Object.assign(observation.identity, { family: resolution.static_id, status: 'verified', basis: resolution.anchors, reason: resolution.reason });
|
|
421
553
|
}
|
|
554
|
+
if (this.looksLoading(observation)) { observation.loading = true; }
|
|
555
|
+
// Seen loaded: its loading passes, so a wait that ran out there was a slow load (awaitContent).
|
|
556
|
+
// Only the first run-out is forgiven: a page that runs out again after that flips between
|
|
557
|
+
// a loading-looking and a loaded view (a spinner a scroll hides) and keeps its zero wait.
|
|
558
|
+
else if (resolution.status === 'verified' && this._loadingStuck?.has(resolution.static_id)
|
|
559
|
+
&& !(this._loadingForgiven ??= new Set()).has(resolution.static_id)) {
|
|
560
|
+
this._loadingStuck.delete(resolution.static_id);
|
|
561
|
+
this._loadingForgiven.add(resolution.static_id);
|
|
562
|
+
}
|
|
422
563
|
this.current = observation;
|
|
423
564
|
this.emit('observation', observation, Object.values(observation.artifacts));
|
|
565
|
+
if (observation.loading && !acceptLoading) { return observation; }
|
|
566
|
+
this.mapCapture(observation);
|
|
567
|
+
return observation;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/** The `mapping` events of a verified capture: its page, then its in-page states. */
|
|
571
|
+
mapCapture(observation) {
|
|
572
|
+
const resolution = observation.static_resolution;
|
|
573
|
+
const states = get(resolution, 'ui_states', []) || [];
|
|
574
|
+
const loading = observation.loading ? { loading: true } : {};
|
|
424
575
|
if (resolution.status === 'verified') {
|
|
425
576
|
const key = tupleKey(this.env, observation.observation_id, resolution.static_id);
|
|
426
577
|
if (!this.mapped.has(key)) {
|
|
427
578
|
this.emit('mapping', { static_id: resolution.static_id, observation_id: observation.observation_id,
|
|
428
|
-
method: resolution.reason, anchors: resolution.anchors }, Object.values(observation.artifacts));
|
|
579
|
+
method: resolution.reason, anchors: resolution.anchors, ...loading }, Object.values(observation.artifacts));
|
|
429
580
|
this.mapped.add(key);
|
|
430
581
|
if (this._recognized !== undefined) { this._recognized.add(resolution.static_id); }
|
|
431
582
|
}
|
|
@@ -435,7 +586,7 @@ export class Runner {
|
|
|
435
586
|
const key = tupleKey(this.env, observation.observation_id, sid);
|
|
436
587
|
if (this.mapped.has(key)) { continue; }
|
|
437
588
|
this.emit('mapping', { static_id: sid, observation_id: observation.observation_id, method: 'ui-state-anchor',
|
|
438
|
-
host_static: resolution.static_id }, Object.values(observation.artifacts));
|
|
589
|
+
host_static: resolution.static_id, ...loading }, Object.values(observation.artifacts));
|
|
439
590
|
this.mapped.add(key);
|
|
440
591
|
if (this._recognized !== undefined) { this._recognized.add(sid); }
|
|
441
592
|
if (this.covered !== undefined) { this.covered.add(sid); }
|
|
@@ -443,6 +594,30 @@ export class Runner {
|
|
|
443
594
|
return observation;
|
|
444
595
|
}
|
|
445
596
|
|
|
597
|
+
/**
|
|
598
|
+
* awaitContent(observation): while the page looksLoading, capture again every 0.5 s for up to
|
|
599
|
+
* `content_wait_seconds` (default 10). A page that is still loading then is mapped as it is,
|
|
600
|
+
* flagged `loading`. Captures only, no action is spent. A page that ran out the wait is not
|
|
601
|
+
* waited on again until a capture shows it loaded: what looks like loading there may be how the
|
|
602
|
+
* page stays (an empty state, a sparse screen, a spinner or a literal `%s` that never goes), and
|
|
603
|
+
* every later action landing on it would pay the full wait. A page seen loaded since loads
|
|
604
|
+
* slowly rather than never (a slow first fetch), so its next visit waits again.
|
|
605
|
+
*/
|
|
606
|
+
awaitContent(observation) {
|
|
607
|
+
let current = observation;
|
|
608
|
+
if (!current || !current.loading) { return current; }
|
|
609
|
+
const stuck = (this._loadingStuck ??= new Set());
|
|
610
|
+
const sid = () => get(get(current, 'static_resolution', {}), 'static_id');
|
|
611
|
+
const wait = stuck.has(sid()) ? 0 : toFloat(get(this.config, 'content_wait_seconds', 10));
|
|
612
|
+
const deadline = monotonic() + Math.max(0, wait);
|
|
613
|
+
while (current.loading && monotonic() < deadline) { sleep(0.5); current = this.capture(); }
|
|
614
|
+
if (current.loading) {
|
|
615
|
+
if (wait > 0) { stuck.add(sid()); }
|
|
616
|
+
this.mapCapture(current);
|
|
617
|
+
}
|
|
618
|
+
return current;
|
|
619
|
+
}
|
|
620
|
+
|
|
446
621
|
at(ident) { return deps.observationMatchesStatic(or(this.current, {}), ident, this.catalog)[0]; }
|
|
447
622
|
|
|
448
623
|
appUiReady() {
|
|
@@ -462,6 +637,8 @@ export class Runner {
|
|
|
462
637
|
}
|
|
463
638
|
const before = this.current;
|
|
464
639
|
this.used += 1;
|
|
640
|
+
// A launch that throws must not leave an earlier launch's consent window open.
|
|
641
|
+
if (get(action, 'type') === 'launch') { this._launched = false; }
|
|
465
642
|
const started = this.emit('attempt_started', { task_id: taskId, atomic: true, purpose, action, before: before.observation_id });
|
|
466
643
|
this.device.act(action, before);
|
|
467
644
|
this.device.settle();
|
|
@@ -481,6 +658,11 @@ export class Runner {
|
|
|
481
658
|
}
|
|
482
659
|
if (!this.appUiReady()) { throw new AdapterError('launch-ui-not-ready'); }
|
|
483
660
|
}
|
|
661
|
+
after = this.awaitContent(after);
|
|
662
|
+
// consentAccept: from a launch until the first action that can raise a dialog of its own.
|
|
663
|
+
// Waits and scrolls press nothing (app_settings' launch → wait → replay; a search scroll on
|
|
664
|
+
// the first replay step), and dismissals are the consent handling itself.
|
|
665
|
+
if (get(action, 'type') === 'launch') { this._launched = true; } else if (purpose !== 'dismiss-interruption' && !PASSIVE_ACTIONS.has(get(action, 'type'))) { this._launched = false; }
|
|
484
666
|
const outcome = observationKey(before) === observationKey(after) ? 'no_effect' : 'succeeded';
|
|
485
667
|
return this.emit('action_result', { task_id: taskId, attempt_id: started.id, purpose, outcome,
|
|
486
668
|
before: before.observation_id, after: after.observation_id, action });
|
|
@@ -551,15 +733,20 @@ export class Runner {
|
|
|
551
733
|
if (matching(this.current.nodes, selector).length) { return true; }
|
|
552
734
|
if (this.clearInterruption(taskId) && matching(this.current.nodes, selector).length) { return true; }
|
|
553
735
|
if (!this.appUiReady()) { return false; }
|
|
554
|
-
|
|
736
|
+
// Positions count (_viewSig): a list of rows without text moves only its bounds.
|
|
737
|
+
const origin = _viewSig(this.current);
|
|
555
738
|
for (const direction of ['down', 'up']) {
|
|
556
|
-
const seen = new Set([
|
|
739
|
+
const seen = new Set([_viewSig(this.current)]);
|
|
740
|
+
const stuck = new Set();
|
|
557
741
|
for (let k = 0; k < toInt(get(this.config, 'max_scrolls_per_task', 6)); k++) {
|
|
558
|
-
const
|
|
559
|
-
if (
|
|
560
|
-
|
|
742
|
+
const found = this.searchContainer(stuck);
|
|
743
|
+
if (!found) { break; }
|
|
744
|
+
const sel = found[1];
|
|
745
|
+
const prev = _viewSig(this.current);
|
|
746
|
+
this.atom({ type: 'scroll', selector: sel, direction }, taskId, 'search');
|
|
561
747
|
if (matching(this.current.nodes, selector).length) { return true; }
|
|
562
|
-
const key =
|
|
748
|
+
const key = _viewSig(this.current);
|
|
749
|
+
if (key === prev) { stuck.add(stuckKey(found[0])); continue; }
|
|
563
750
|
if (seen.has(key) || this._backAtOrigin(direction, key, origin)) { break; }
|
|
564
751
|
seen.add(key);
|
|
565
752
|
}
|
|
@@ -567,6 +754,24 @@ export class Runner {
|
|
|
567
754
|
return false;
|
|
568
755
|
}
|
|
569
756
|
|
|
757
|
+
/**
|
|
758
|
+
* The vertical container a bounded search scrolls next, as [node, selector]: the only one, else
|
|
759
|
+
* the largest not yet found immobile in this pass. Requiring exactly one skipped every scroll on
|
|
760
|
+
* screens with several (measured, Simple Calendar week view: hours column, events list and the
|
|
761
|
+
* pager). The selector names this very node: copies sharing a resource id (one per pager page)
|
|
762
|
+
* are told apart by class and position, so one immobile copy does not rule out the others.
|
|
763
|
+
*/
|
|
764
|
+
searchContainer(stuck) {
|
|
765
|
+
const nodes = this.current.nodes;
|
|
766
|
+
const own = (n) => (truthy(get(n, 'resource_id')) && matching(nodes, { resource_id: n.resource_id }).length === 1
|
|
767
|
+
? { resource_id: n.resource_id } : (classIndexSel(n, nodes) ?? scrollSel(n, nodes)));
|
|
768
|
+
const conts = nodes.filter((n) => truthy(get(n, 'scrollable')) && isVisible(n) && !_isHorizontal(n) && !stuck.has(stuckKey(n)))
|
|
769
|
+
.map((n) => [n, own(n)]);
|
|
770
|
+
if (conts.length <= 1) { return conts[0] ?? null; }
|
|
771
|
+
const area = ([n]) => { const b = or(get(n, 'bounds'), [0, 0, 0, 0]); return Math.max(0, b[2] - b[0]) * Math.max(0, b[3] - b[1]); };
|
|
772
|
+
return sortedBy(conts, (c) => -area(c))[0];
|
|
773
|
+
}
|
|
774
|
+
|
|
570
775
|
/**
|
|
571
776
|
* The upward search pass is back where the downward pass started: everything below was
|
|
572
777
|
* already searched, and one more upward swipe at the top of a list is a pull-to-refresh
|
|
@@ -603,34 +808,147 @@ export class Runner {
|
|
|
603
808
|
* Dismiss a dialog nobody asked for -- one that is neither the page the running task starts
|
|
604
809
|
* from nor the page it looks for (`this.keep`) -- so it does not eat the search budget.
|
|
605
810
|
* Action: the first matching `interruption_rules` entry ({id?, when: <rule>, action}), else
|
|
606
|
-
*
|
|
811
|
+
* the app's own consent dialog is accepted (consentAccept), else Back, then the negative
|
|
812
|
+
* button (android:id/button2) for a dialog Back does not close. A consent dialog that offers a
|
|
813
|
+
* decline (button2, or a label CONSENT_DECLINE_RE names: 「拒绝并退出」) and nothing safe to
|
|
814
|
+
* accept with is left as it is, logged with outcome `unresolved`: there Back closes the Activity
|
|
815
|
+
* and button2 leaves the app. One without a decline (a 「登录即同意《用户协议》」 one-tap login
|
|
816
|
+
* sheet) keeps the generic dismissal. Ticking a consent box does not use up a dismissal (two
|
|
817
|
+
* required boxes, then the accept), up to `limit` ticks.
|
|
607
818
|
* Each dismissal is an `interruption` event. Returns true when something was dismissed.
|
|
608
819
|
*/
|
|
609
820
|
clearInterruption(taskId) {
|
|
610
821
|
const limit = toInt(get(this.config, 'max_interruption_dismissals', 2));
|
|
611
822
|
let dismissed = false;
|
|
612
|
-
|
|
823
|
+
let ticks = 0;
|
|
824
|
+
for (let k = 0; k < limit + ticks; k++) {
|
|
613
825
|
const bounds = this.modalOverlay();
|
|
614
826
|
if (!bounds) { break; }
|
|
615
827
|
const res = or(get(this.current, 'static_resolution'), {});
|
|
616
828
|
if (get(res, 'status') === 'verified' && (this.keep ?? []).includes(get(res, 'static_id'))) { break; }
|
|
617
829
|
const rule = get(this.config, 'interruption_rules', []).find((r) => ruleMatches(this.current, get(r, 'when', {})));
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
action = { type: 'click', selector: { resource_name: 'button2' } };
|
|
621
|
-
}
|
|
830
|
+
const isConsent = !rule && this.consentDialog();
|
|
831
|
+
const consent = isConsent ? this.consentAccept() : null;
|
|
622
832
|
const texts = this.current.nodes.map((n) => or(get(n, 'text'), get(n, 'content_desc'))).filter((t) => truthy(t));
|
|
623
833
|
const before = this.current.observation_id;
|
|
834
|
+
if (isConsent && !consent && this.consentDecline()) {
|
|
835
|
+
this.emit('interruption', { task_id: taskId, observation_id: before, bounds, action: null, rule: 'consent-default',
|
|
836
|
+
texts: texts.slice(0, 6).map((t) => cpSlice(pyStr(t), 0, 80)), outcome: 'unresolved' });
|
|
837
|
+
break;
|
|
838
|
+
}
|
|
839
|
+
let action = rule ? rule.action : (consent ?? { type: 'back' });
|
|
840
|
+
if (!rule && !consent && k > 0 && matching(this.current.nodes, { resource_name: 'button2' }).length === 1) {
|
|
841
|
+
action = { type: 'click', selector: { resource_name: 'button2' } };
|
|
842
|
+
}
|
|
843
|
+
const tick = consent !== null && isToggle(matching(this.current.nodes, consent.selector)[0] ?? {});
|
|
624
844
|
const result = this.atom(action, taskId, 'dismiss-interruption');
|
|
625
845
|
this.emit('interruption', { task_id: taskId, observation_id: before, bounds, action,
|
|
626
|
-
rule: rule ? get(rule, 'id', null) : null, texts: texts.slice(0, 6).map((t) => cpSlice(pyStr(t), 0, 80)),
|
|
846
|
+
rule: rule ? get(rule, 'id', null) : (consent ? 'consent-default' : null), texts: texts.slice(0, 6).map((t) => cpSlice(pyStr(t), 0, 80)),
|
|
627
847
|
outcome: result.payload.outcome });
|
|
628
|
-
|
|
848
|
+
// A rule or a consent click that did nothing would do nothing again; Back/button2 would leave.
|
|
849
|
+
if (result.payload.outcome === 'no_effect' && (rule || consent)) { break; }
|
|
850
|
+
if (tick && ticks < limit) { ticks += 1; }
|
|
629
851
|
dismissed = dismissed || result.payload.outcome === 'succeeded';
|
|
630
852
|
}
|
|
631
853
|
return dismissed;
|
|
632
854
|
}
|
|
633
855
|
|
|
856
|
+
/**
|
|
857
|
+
* The app's own first-launch consent dialog (privacy policy / user agreement): Back closes the
|
|
858
|
+
* Activity and its negative button is "decline and exit", so the generic dismissal leaves the
|
|
859
|
+
* app (measured, where2study 11-04: with reset_between_tasks every task cleared data, met the
|
|
860
|
+
* dialog, pressed Back then button2 「拒绝并退出」 and ended on the launcher; 0 of 64 tasks
|
|
861
|
+
* confirmed). Accept it with its positive control instead (consentPositive: android:id/button1
|
|
862
|
+
* unless its label declines, else a custom layout's one 「同意」/「同意并继续」/"Agree" node
|
|
863
|
+
* that is not a toggle). Only when that control is present but disabled is a CheckBox ticked
|
|
864
|
+
* first (「我已阅读并同意」 keeps it disabled until ticked): the first unticked one whose text
|
|
865
|
+
* names consent (one per call, so two required boxes take two), else the only unticked one;
|
|
866
|
+
* several unticked boxes none of which names consent (「接收推送」) are not guessed at. Without
|
|
867
|
+
* a safe control it returns null; clearInterruption then leaves a dialog that offers a decline
|
|
868
|
+
* (consentDecline) rather than Back, and dismisses any other the generic way.
|
|
869
|
+
* Which dialogs count is consentDialog's call.
|
|
870
|
+
* `consent_default: false` turns it off. Returns the click action, or null.
|
|
871
|
+
*/
|
|
872
|
+
consentAccept() {
|
|
873
|
+
if (!this.consentDialog()) { return null; }
|
|
874
|
+
const nodes = get(this.current, 'nodes', []);
|
|
875
|
+
const positive = this.consentPositive(nodes);
|
|
876
|
+
if (!positive) { return null; }
|
|
877
|
+
// The selector must still name the control itself: matching() drops disabled nodes, so a disabled
|
|
878
|
+
// 「同意」 button would leave a same-labelled 「同意」 CheckBox as the one hit.
|
|
879
|
+
const live = matching(nodes, positive.selector);
|
|
880
|
+
if (live.length === 1 && live[0] === positive.node) { return { type: 'click', selector: positive.selector }; }
|
|
881
|
+
if (get(positive.node, 'enabled', true) !== false) { return null; }
|
|
882
|
+
// The positive control is there but disabled: tick the box that enables it.
|
|
883
|
+
const boxes = matching(nodes, { checked: false }).filter((n) => pyStr(get(n, 'class', '')).endsWith('CheckBox'));
|
|
884
|
+
const worded = boxes.filter((n) => CONSENT_BOX_RE.test(pyStr(or(get(n, 'text'), get(n, 'content_desc'), ''))));
|
|
885
|
+
const box = worded.length ? worded[0] : (boxes.length === 1 ? boxes[0] : null);
|
|
886
|
+
const selector = box ? classIndexSel(box, nodes) : null;
|
|
887
|
+
const hits = selector ? matching(nodes, selector) : [];
|
|
888
|
+
return hits.length === 1 && hits[0] === box ? { type: 'click', selector } : null;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* Whether the screen is the app's own first-launch consent dialog: the policy wording is read
|
|
893
|
+
* from text and content_desc (a WebView body exposes only the latter). Applies only to a dialog
|
|
894
|
+
* of the app under test (a node without a package counts as its own, as in looksLoading) whose
|
|
895
|
+
* text names a policy or agreement, met after a launch and before any action other than a
|
|
896
|
+
* dismissal (`_launched`, set in atom): a dialog the app raises by itself on start. One that
|
|
897
|
+
* names a policy after the task pressed something (「撤回同意」, 「注销账号」, 「登录即同意」)
|
|
898
|
+
* confirms that press and keeps the generic dismissal. `consent_default: false` turns it off.
|
|
899
|
+
*/
|
|
900
|
+
consentDialog() {
|
|
901
|
+
if (get(this.config, 'consent_default', true) === false || !this._launched) { return false; }
|
|
902
|
+
const pkg = get(this.config, 'package');
|
|
903
|
+
const nodes = get(this.current, 'nodes', []);
|
|
904
|
+
if (truthy(pkg) && (get(this.current, 'package', pkg) !== pkg || !nodes.some((n) => get(n, 'package', pkg) === pkg))) { return false; }
|
|
905
|
+
// content_desc too: a WebView body or a Compose/ImageView label exposes its words only there.
|
|
906
|
+
const text = nodes.flatMap((n) => [get(n, 'text'), get(n, 'content_desc')]).filter((t) => truthy(t)).map((t) => pyStr(t)).join('\n');
|
|
907
|
+
return CONSENT_RE.test(text);
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Whether the consent dialog offers a way to decline: android:id/button2, or a visible control
|
|
912
|
+
* whose whole label declines (「不同意」「拒绝并退出」, CONSENT_DECLINE_RE). On such a dialog Back
|
|
913
|
+
* closes the Activity and button2 leaves the app; one without (a login sheet whose fine print names
|
|
914
|
+
* the agreement) is safe to dismiss with Back.
|
|
915
|
+
*/
|
|
916
|
+
consentDecline() {
|
|
917
|
+
const nodes = get(this.current, 'nodes', []);
|
|
918
|
+
return nodes.some((n) => isVisible(n) && (get(n, 'resource_id') === 'android:id/button2'
|
|
919
|
+
|| (!isToggle(n) && [get(n, 'text'), get(n, 'content_desc')].some((v) => truthy(v)
|
|
920
|
+
&& [...normalized(v)].length <= 12 && CONSENT_DECLINE_RE.test(normalized(v))))));
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* The consent dialog's positive control: android:id/button1 (the AlertDialog positive button,
|
|
925
|
+
* its full id) unless its label declines (CONSENT_DECLINE_RE: 「不同意」/「退出」 put there),
|
|
926
|
+
* else the one visible non-toggle node whose whole text or content_desc is an accept
|
|
927
|
+
* (CONSENT_POSITIVE_RE) -- a custom-layout dialog's 「同意」 TextView, not a 「同意」 CheckBox,
|
|
928
|
+
* named by class and index when a toggle shares its label. Returns {node, selector}, or null
|
|
929
|
+
* when there is none or more than one.
|
|
930
|
+
*/
|
|
931
|
+
consentPositive(nodes) {
|
|
932
|
+
const button1 = nodes.filter((n) => isVisible(n) && get(n, 'resource_id') === 'android:id/button1');
|
|
933
|
+
if (button1.length > 1) { return null; }
|
|
934
|
+
if (button1.length === 1 && !CONSENT_DECLINE_RE.test(normalized(or(get(button1[0], 'text'), get(button1[0], 'content_desc'), '')))) {
|
|
935
|
+
return { node: button1[0], selector: { resource_id: 'android:id/button1' } };
|
|
936
|
+
}
|
|
937
|
+
const hits = [];
|
|
938
|
+
for (const n of nodes) {
|
|
939
|
+
if (!isVisible(n) || isToggle(n)) { continue; }
|
|
940
|
+
for (const key of ['text', 'content_desc']) {
|
|
941
|
+
const v = get(n, key);
|
|
942
|
+
if (truthy(v) && CONSENT_POSITIVE_RE.test(normalized(v))) {
|
|
943
|
+
const sel = { [key]: v };
|
|
944
|
+
hits.push({ node: n, selector: matching(nodes, sel).length > 1 ? (classIndexSel(n, nodes) ?? sel) : sel });
|
|
945
|
+
break;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
return hits.length === 1 ? hits[0] : null;
|
|
950
|
+
}
|
|
951
|
+
|
|
634
952
|
// -- top-to-bottom scroll sweep ---------------------------------------------
|
|
635
953
|
|
|
636
954
|
sweepEnabled() { return truthy(get(this.config, 'scroll_sweep', true)); }
|
|
@@ -683,8 +1001,12 @@ export class Runner {
|
|
|
683
1001
|
* sweep aborted `left-page` with no frame although the list sat at the same [42,310,1038,2400].
|
|
684
1002
|
*/
|
|
685
1003
|
_surfaceSelector(origin, selector, container) {
|
|
686
|
-
if (this._sameSurface(origin, selector)) { return selector; }
|
|
687
1004
|
const cur = this.current;
|
|
1005
|
+
if (this._sameSurface(origin, selector)) {
|
|
1006
|
+
// a drifted {class, index} can land on another scrollable (a LazyRow above the list)
|
|
1007
|
+
const [hit] = matching(get(cur, 'nodes', []), selector);
|
|
1008
|
+
if (!_isHorizontal(hit) && get(hit, 'class') === get(container, 'class')) { return selector; }
|
|
1009
|
+
}
|
|
688
1010
|
if (get(cur, 'package') !== get(origin, 'package') || get(cur, 'activity') !== get(origin, 'activity')
|
|
689
1011
|
|| get(cur, 'window') !== get(origin, 'window')) { return null; }
|
|
690
1012
|
const ob = or(get(container, 'bounds'), []);
|
|
@@ -904,27 +1226,35 @@ export class Runner {
|
|
|
904
1226
|
let lastKey = observationKey(this.current);
|
|
905
1227
|
while (monotonic() < waitUntil) {
|
|
906
1228
|
sleep(0.5);
|
|
907
|
-
this.capture();
|
|
1229
|
+
this.capture({ acceptLoading: true });
|
|
908
1230
|
selected = this.choose(action);
|
|
909
1231
|
if (selected) { return this.atom(selected, taskId, purpose); }
|
|
910
1232
|
const key = observationKey(this.current);
|
|
911
1233
|
if (key === lastKey) { break; }
|
|
912
1234
|
lastKey = key;
|
|
913
1235
|
}
|
|
914
|
-
|
|
1236
|
+
// Positions count (_viewSig): a list of rows without text moves only its bounds.
|
|
1237
|
+
const origin = _viewSig(this.current);
|
|
915
1238
|
for (const direction of ['down', 'up']) {
|
|
916
|
-
const seen = new Set([
|
|
1239
|
+
const seen = new Set([_viewSig(this.current)]);
|
|
1240
|
+
const stuck = new Set();
|
|
917
1241
|
for (let k = 0; k < toInt(get(this.config, 'max_scrolls_per_task', 6)); k++) {
|
|
918
|
-
const
|
|
919
|
-
if (
|
|
920
|
-
|
|
1242
|
+
const found = this.searchContainer(stuck);
|
|
1243
|
+
if (!found) { break; }
|
|
1244
|
+
const sel = found[1];
|
|
1245
|
+
const prev = _viewSig(this.current);
|
|
1246
|
+
this.atom({ type: 'scroll', selector: sel, direction }, taskId, 'search');
|
|
921
1247
|
selected = this.choose(action);
|
|
922
1248
|
if (selected) { return this.atom(selected, taskId, purpose); }
|
|
1249
|
+
// A dismissed dialog changes the screen without the list moving: measure the list alone.
|
|
1250
|
+
const after = _viewSig(this.current);
|
|
923
1251
|
if (this.clearInterruption(taskId)) {
|
|
924
1252
|
selected = this.choose(action);
|
|
925
1253
|
if (selected) { return this.atom(selected, taskId, purpose); }
|
|
926
1254
|
}
|
|
927
|
-
const key =
|
|
1255
|
+
const key = _viewSig(this.current);
|
|
1256
|
+
// A container that did not move (a pager, a list already at its end) leaves the others to try.
|
|
1257
|
+
if (after === prev) { stuck.add(stuckKey(found[0])); continue; }
|
|
928
1258
|
if (seen.has(key) || this._backAtOrigin(direction, key, origin)) { break; }
|
|
929
1259
|
seen.add(key);
|
|
930
1260
|
}
|
|
@@ -968,12 +1298,18 @@ export class Runner {
|
|
|
968
1298
|
const source = task.source_static;
|
|
969
1299
|
const dirty = this.dirty ?? false;
|
|
970
1300
|
const [matched, how] = deps.observationMatchesStatic(or(this.current, {}), source, this.catalog);
|
|
971
|
-
|
|
1301
|
+
// A dialog an earlier task opened still resolves to its host activity: the source "matches" but
|
|
1302
|
+
// its controls sit behind the dialog (measured: a font-size picker left open failed two later
|
|
1303
|
+
// Settings tasks with no scroll). Relaunch instead of searching under it.
|
|
1304
|
+
const srcKind = pyStr(get(get(this.catalog, source, {}), 'kind') ?? pyStr(source).split(':')[0]);
|
|
1305
|
+
const floating = ['panel', 'dialog'].includes(srcKind);
|
|
1306
|
+
// With reset_between_tasks every task starts from cleared data, even one already on its source.
|
|
1307
|
+
if (matched && how === 'exact-page' && !dirty && (floating || !this.modalOverlay()) && !this.resetsBetweenTasks()) { return; }
|
|
972
1308
|
// Back only when it can land on the source: from a root page (or any page the source never
|
|
973
1309
|
// opens) it just leaves the app, costing an action before the relaunch below anyway.
|
|
974
1310
|
const here = get(get(this.current, 'static_resolution', {}), 'status') === 'verified'
|
|
975
1311
|
? this.current.static_resolution.static_id : null;
|
|
976
|
-
if (this.current.package === mget(this.config, 'package') && !matched && !dirty
|
|
1312
|
+
if (this.current.package === mget(this.config, 'package') && !matched && !dirty && !this.resetsBetweenTasks()
|
|
977
1313
|
&& !(here !== null && (this.backExits ?? new Set()).has(here))
|
|
978
1314
|
&& backCanReach(this.current, source, this.catalog)) {
|
|
979
1315
|
this.atom({ type: 'back' }, task.task_id, 'recover');
|
|
@@ -993,7 +1329,9 @@ export class Runner {
|
|
|
993
1329
|
if (memo.has(k)) { throw new PrefixFailed(memo.get(k), k); }
|
|
994
1330
|
}
|
|
995
1331
|
}
|
|
1332
|
+
this.resetBetweenTasks(task.task_id);
|
|
996
1333
|
this.atom(launch, task.task_id, 'recover');
|
|
1334
|
+
this.launchBridge(task);
|
|
997
1335
|
const attested = new Set();
|
|
998
1336
|
for (let i = 0; i < replay.length; i++) {
|
|
999
1337
|
const step = replay[i];
|
|
@@ -1030,6 +1368,40 @@ export class Runner {
|
|
|
1030
1368
|
}
|
|
1031
1369
|
}
|
|
1032
1370
|
|
|
1371
|
+
/**
|
|
1372
|
+
* The launch reached another page (a first-run Guide) instead of the ones it opens by itself
|
|
1373
|
+
* (`launch_chain`, Splash → Main): take that page's compiled exit into the chain. This runs on
|
|
1374
|
+
* every launch that lands off the chain; the exit usually writes the first-run flag, so later
|
|
1375
|
+
* launches stop landing there and the bridge stops firing.
|
|
1376
|
+
* Measured (coolmall 2026-10-29): without it every cold launch stayed on Guide, every task
|
|
1377
|
+
* behind Main failed source-unverified, and Guide was the only page captured.
|
|
1378
|
+
* A launch still standing on its own page (`launch_page`, a Splash whose timer outlasts the
|
|
1379
|
+
* settle) is watched for up to `launch_chain_wait_seconds` (default 6) until it leaves it:
|
|
1380
|
+
* deciding on Splash would miss the Guide that comes after it.
|
|
1381
|
+
*/
|
|
1382
|
+
launchBridge(task) {
|
|
1383
|
+
const chain = or(get(task, 'launch_chain'), []);
|
|
1384
|
+
if (!chain.length) { return; }
|
|
1385
|
+
const first = get(task, 'launch_page');
|
|
1386
|
+
if (truthy(first) && !chain.includes(first)) {
|
|
1387
|
+
const deadline = monotonic() + Math.max(0, toFloat(get(this.config, 'launch_chain_wait_seconds', 6)));
|
|
1388
|
+
while (this.at(first) && !chain.some((p) => this.at(p)) && monotonic() < deadline) { sleep(0.5); this.capture(); }
|
|
1389
|
+
}
|
|
1390
|
+
if (get(this.current, 'package') !== get(this.config, 'package') || chain.some((p) => this.at(p))) { return; }
|
|
1391
|
+
const exit = get(this.doc, 'tasks', []).find((t) => get(t, 'status') === 'compiled' && chain.includes(get(t, 'target_static'))
|
|
1392
|
+
&& !chain.includes(get(t, 'source_static')) && !truthy(get(t, 'replay')) && !truthy(get(get(t, 'action'), 'automatic'))
|
|
1393
|
+
&& get(get(t, 'action'), 'type') !== 'unresolved' && this.at(get(t, 'source_static')));
|
|
1394
|
+
if (!exit) { return; }
|
|
1395
|
+
this.emit('launch_bridge', { task_id: task.task_id, via: exit.task_id, from: exit.source_static, to: exit.target_static,
|
|
1396
|
+
observation_id: get(this.current, 'observation_id') });
|
|
1397
|
+
try {
|
|
1398
|
+
for (const step of [...or(get(exit, 'prelude'), []), exit.action]) { this.seek(step, task.task_id, 'launch-bridge'); }
|
|
1399
|
+
} catch (e) {
|
|
1400
|
+
if (!(e instanceof AdapterError) || TRANSIENT_DEVICE_RE.test(errStr(e))) { throw e; }
|
|
1401
|
+
this.emit('launch_bridge_failed', { task_id: task.task_id, via: exit.task_id, reason: errStr(e) });
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1033
1405
|
/**
|
|
1034
1406
|
* True when the page has no anchor it always shows (title, rows, layout ids). Body texts do
|
|
1035
1407
|
* not count: they are presence-only evidence and may sit in a branch or a dialog the page opens.
|
|
@@ -1098,8 +1470,11 @@ export class Runner {
|
|
|
1098
1470
|
const ident = task.task_id;
|
|
1099
1471
|
try {
|
|
1100
1472
|
this.stage = 'direct-launch';
|
|
1473
|
+
this.resetBetweenTasks(ident);
|
|
1101
1474
|
this.atom(task.source_launch, ident, 'direct-launch');
|
|
1102
1475
|
for (const step of or(get(task, 'prelude'), [])) { this.seek(step, ident, 'direct-launch'); }
|
|
1476
|
+
// A dialog over the target (a first-launch consent dialog; without a prelude no seek clears it).
|
|
1477
|
+
if (!this.at(task.target_static)) { this.clearInterruption(ident); }
|
|
1103
1478
|
const confirmed = this.at(task.target_static);
|
|
1104
1479
|
if (confirmed) { done.add(ident); }
|
|
1105
1480
|
this.emit('task_result', { task_id: ident, outcome: confirmed ? 'confirmed' : 'target-unverified',
|
|
@@ -1230,16 +1605,32 @@ export class Runner {
|
|
|
1230
1605
|
* it to false (for the whole config, or runs those phases with a config that does).
|
|
1231
1606
|
* Returns [granted, failed].
|
|
1232
1607
|
*/
|
|
1233
|
-
grantRuntimePermissions() {
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1608
|
+
grantRuntimePermissions() { return grantRuntimePermissions(this.device, this.config); }
|
|
1609
|
+
|
|
1610
|
+
/**
|
|
1611
|
+
* `config.reset_between_tasks` (true, or a list of phase ids): clear app data before a task's
|
|
1612
|
+
* launch, so a setting one task changed does not reshape the next one's start page (measured,
|
|
1613
|
+
* Simple Calendar: a task chose the week view, the app stored it, and every later launch opened
|
|
1614
|
+
* on a week view with no FAB). `am start -S` only kills the process. Applies only to a phase with
|
|
1615
|
+
* no fixtures: a fixture-built state would be wiped with nothing to rebuild it.
|
|
1616
|
+
*/
|
|
1617
|
+
resetsBetweenTasks() {
|
|
1618
|
+
const want = get(this.config, 'reset_between_tasks', false);
|
|
1619
|
+
const on = Array.isArray(want) ? want.includes(get(this.phase, 'id')) : truthy(want);
|
|
1620
|
+
return on && !get(get(this.config, 'fixtures', {}), get(this.phase, 'id'), []).length;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
/**
|
|
1624
|
+
* Once per task: a second source() of the same task (after a sweep left the page scrolled) only
|
|
1625
|
+
* needs the relaunch, since nothing between the two calls could store a setting. Each clear
|
|
1626
|
+
* costs an action and a cold start. A backlog sweep route (`sweep:<id>`) is its own visit and
|
|
1627
|
+
* clears again: the task before it may have changed a setting.
|
|
1628
|
+
*/
|
|
1629
|
+
resetBetweenTasks(taskId) {
|
|
1630
|
+
if (!this.resetsBetweenTasks() || (taskId !== undefined && this._clearedFor === taskId)) { return; }
|
|
1631
|
+
this.atom({ type: 'clear_app_data' }, taskId, 'recover');
|
|
1632
|
+
this.grantRuntimePermissions();
|
|
1633
|
+
this._clearedFor = taskId;
|
|
1243
1634
|
}
|
|
1244
1635
|
|
|
1245
1636
|
/**
|
|
@@ -1264,8 +1655,16 @@ export class Runner {
|
|
|
1264
1655
|
// A fixture's own save step only exists to hand its state to later phases. When the phase
|
|
1265
1656
|
// runs again (next round, resume) the archive is the one this fixture already wrote: keep it
|
|
1266
1657
|
// (never overwrite) and continue, instead of blocking the phase on its own artifact.
|
|
1267
|
-
|
|
1268
|
-
|
|
1658
|
+
const kept = ['snapshot_app_data', 'save_replay'].includes(get(action, 'type')) && truthy(get(action, 'archive'))
|
|
1659
|
+
&& fs.existsSync(pathStr(action.archive));
|
|
1660
|
+
// A kept .tar that is not a whole archive would restore a half state into every later
|
|
1661
|
+
// phase: move it aside (never delete) and let the fixture write it again.
|
|
1662
|
+
const bad = kept && action.type === 'snapshot_app_data' ? tarProblem(pathStr(action.archive)) : null;
|
|
1663
|
+
if (bad) {
|
|
1664
|
+
const aside = `${pathStr(action.archive)}.corrupt-${Date.now()}`;
|
|
1665
|
+
fs.renameSync(pathStr(action.archive), aside);
|
|
1666
|
+
this.emit('fixture_snapshot_corrupt', { phase: this.phase.id, archive: pathStr(action.archive), reason: bad, moved_to: aside });
|
|
1667
|
+
} else if (kept) {
|
|
1269
1668
|
this.emit('fixture_snapshot_kept', { phase: this.phase.id, type: action.type, archive: pathStr(action.archive) });
|
|
1270
1669
|
continue;
|
|
1271
1670
|
}
|
|
@@ -1296,7 +1695,8 @@ export class Runner {
|
|
|
1296
1695
|
}
|
|
1297
1696
|
|
|
1298
1697
|
run() {
|
|
1299
|
-
this.
|
|
1698
|
+
this._launched = false;
|
|
1699
|
+
this.awaitContent(this.capture());
|
|
1300
1700
|
const tasks = get(this.doc, 'tasks', []).filter((t) => t.phase === this.phase.id);
|
|
1301
1701
|
const probesFor = get(get(this.config, 'phase_probes', {}), this.phase.id);
|
|
1302
1702
|
if (truthy(this.phase.requires) && !truthy(probesFor)) {
|
|
@@ -1369,6 +1769,8 @@ export class Runner {
|
|
|
1369
1769
|
scheduled += 1; starts.set(ident, (starts.get(ident) ?? 0) + 1);
|
|
1370
1770
|
this.emit('task_started', { task_id: ident, target_static: task.target_static });
|
|
1371
1771
|
this.keep = [task.source_static, task.target_static, get(task, 'source_context')].filter((x) => truthy(x));
|
|
1772
|
+
this._launched = false; // only a launch of this task's own opens the consent window
|
|
1773
|
+
this._clearedFor = null; // every attempt of a task starts from cleared data (resetBetweenTasks)
|
|
1372
1774
|
if (get(task, 'purpose') === 'direct-launch') { this.runDirect(task, done); continue; }
|
|
1373
1775
|
try {
|
|
1374
1776
|
this._runTask(task, ident, done);
|
|
@@ -1379,6 +1781,15 @@ export class Runner {
|
|
|
1379
1781
|
}
|
|
1380
1782
|
const msg = errStr(exc);
|
|
1381
1783
|
if (msg.includes('does not exist') && msg.includes('Activity class')) {
|
|
1784
|
+
// Only a launch of the app's launcher proves a wrong namespace: an uninstalled module may
|
|
1785
|
+
// have its own MainActivity with the same simple name, and that skips just this task.
|
|
1786
|
+
const mismatch = truthy(get(get(task, 'source_launch'), 'launcher'))
|
|
1787
|
+
? launchMismatch(msg, get(this.config, 'launch_component')) : null;
|
|
1788
|
+
if (mismatch) {
|
|
1789
|
+
this.emit('task_result', { task_id: ident, outcome: 'failed', reason: mismatch, stage: this.stage,
|
|
1790
|
+
target_static: task.target_static });
|
|
1791
|
+
return this._block(mismatch);
|
|
1792
|
+
}
|
|
1382
1793
|
this.emit('task_result', { task_id: ident, outcome: 'unsupported', reason: 'entry-component-not-installed',
|
|
1383
1794
|
stage: this.stage, target_static: task.target_static });
|
|
1384
1795
|
continue;
|