mobile-debug-mcp 0.34.0 → 0.35.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/.agents/skills/mcp-builder/SKILL.md +44 -64
- package/.agents/skills/mcp-builder/references/build-flags.md +44 -43
- package/.agents/skills/mcp-builder/references/diagnostics-schema.md +4 -1
- package/.agents/skills/mcp-builder/references/toolchain-details.md +49 -62
- package/.agents/skills/spec-review/references/spec-review-checklist.md +7 -0
- package/.agents/skills/test-authoring/SKILL.md +7 -6
- package/.agents/skills/test-authoring/references/repo-test-layout.md +3 -1
- package/.agents/skills/test-authoring/references/test-authoring-workflow.md +16 -7
- package/.agents/skills/test-authoring/references/test-quality-checklist.md +2 -1
- package/.github/copilot-instructions.md +14 -36
- package/.github/workflows/ci.yml +4 -4
- package/AGENTS.md +12 -3
- package/CONTRIBUTING.md +79 -0
- package/README.md +156 -129
- package/agent-plugin/.claude-plugin/plugin.json +2 -2
- package/agent-plugin/.codex-plugin/plugin.json +1 -1
- package/agent-plugin/.cursor-plugin/plugin.json +2 -2
- package/agent-plugin/.mcp.json +1 -1
- package/agent-plugin/README.md +16 -6
- package/agent-plugin/mcp.json +1 -1
- package/agent-plugin/plugin.json +1 -1
- package/agent-plugin/skills/mobile-debug-mcp/SKILL.md +27 -2
- package/dist/contracts/execution-controls.js +24 -0
- package/dist/contracts/selector.js +8 -0
- package/dist/contracts/target.js +15 -0
- package/dist/contracts/ui.js +1 -0
- package/dist/debugger/android.js +2 -1
- package/dist/debugger/diagnostics.js +54 -0
- package/dist/debugger/protocol.js +33 -0
- package/dist/debugger/sessions.js +104 -62
- package/dist/debugger/worker.js +53 -42
- package/dist/interact/adjustment/adjustment-context.js +41 -0
- package/dist/interact/adjustment/adjustment-gestures.js +55 -0
- package/dist/interact/adjustment/adjustment-plan.js +18 -0
- package/dist/interact/adjustment/adjustment-resolution.js +127 -0
- package/dist/interact/adjustment/adjustment-result.js +19 -0
- package/dist/interact/adjustment/adjustment-semantic.js +64 -0
- package/dist/interact/adjustment/adjustment-verification.js +35 -0
- package/dist/interact/adjustment/adjustment.js +52 -0
- package/dist/interact/adjustment/control-geometry.js +87 -0
- package/dist/interact/adjustment/control-values.js +136 -0
- package/dist/interact/adjustment/slider-labels.js +84 -0
- package/dist/interact/assertions/screen-assertion.js +37 -0
- package/dist/interact/assertions/state-assertion-context.js +35 -0
- package/dist/interact/assertions/state-assertion.js +76 -0
- package/dist/interact/assertions/state-comparison.js +141 -0
- package/dist/interact/assertions/visibility-assertion.js +34 -0
- package/dist/interact/conditional-action.js +12 -7
- package/dist/interact/index.js +65 -3090
- package/dist/interact/input-service.js +1 -0
- package/dist/interact/interaction-trace.js +21 -0
- package/dist/interact/model.js +1 -0
- package/dist/interact/observation.js +1 -0
- package/dist/interact/targeting/candidate-ancestor.js +58 -0
- package/dist/interact/targeting/candidate-result.js +23 -0
- package/dist/interact/targeting/candidate-scoring.js +50 -0
- package/dist/interact/targeting/element-helpers.js +216 -0
- package/dist/interact/targeting/find-element.js +65 -0
- package/dist/interact/targeting/nearby-control.js +56 -0
- package/dist/interact/targeting/resolved-elements.js +21 -0
- package/dist/interact/targeting/tap-target.js +17 -0
- package/dist/interact/targeting/target-scope.js +104 -0
- package/dist/interact/waits/legacy-log-wait.js +38 -0
- package/dist/interact/waits/legacy-wait-observations.js +103 -0
- package/dist/interact/waits/legacy-wait-state.js +34 -0
- package/dist/interact/waits/legacy-wait.js +48 -0
- package/dist/interact/waits/screen-wait.js +49 -0
- package/dist/interact/waits/ui-change-helpers.js +157 -0
- package/dist/interact/waits/ui-change-state.js +18 -0
- package/dist/interact/waits/ui-change-wait.js +77 -0
- package/dist/interact/waits/ui-wait-condition.js +56 -0
- package/dist/interact/waits/ui-wait-state.js +38 -0
- package/dist/interact/waits/ui-wait.js +106 -0
- package/dist/manage/android.js +55 -51
- package/dist/manage/index.js +38 -75
- package/dist/manage/ios/build-types.js +1 -0
- package/dist/manage/ios/build.js +210 -0
- package/dist/manage/ios/project-discovery.js +29 -0
- package/dist/manage/ios/scheme.js +18 -0
- package/dist/manage/ios.js +42 -256
- package/dist/observe/android/context.js +1 -0
- package/dist/observe/android/current-screen.js +55 -0
- package/dist/observe/android/fingerprint.js +13 -0
- package/dist/observe/android/log-stream.js +132 -0
- package/dist/observe/android/logs.js +107 -0
- package/dist/observe/android/screenshot.js +70 -0
- package/dist/observe/android/ui-tree.js +107 -0
- package/dist/observe/android.js +16 -520
- package/dist/observe/evidence.js +114 -75
- package/dist/observe/index.js +16 -263
- package/dist/observe/ios/context.js +16 -0
- package/dist/observe/ios/fingerprint.js +12 -0
- package/dist/observe/ios/log-stream.js +105 -0
- package/dist/observe/ios/logs.js +168 -0
- package/dist/observe/ios/screenshot.js +22 -0
- package/dist/observe/ios/ui-elements.js +241 -0
- package/dist/observe/ios/ui-tree.js +137 -0
- package/dist/observe/ios.js +17 -715
- package/dist/observe/logs/model.js +1 -0
- package/dist/{network → observe/network}/index.js +2 -2
- package/dist/observe/readiness-service.js +4 -2
- package/dist/observe/readiness.js +29 -10
- package/dist/observe/screenshot-encoding.js +41 -0
- package/dist/observe/snapshot-collection.js +79 -0
- package/dist/observe/snapshot-logs.js +30 -0
- package/dist/observe/snapshot-metadata.js +43 -31
- package/dist/observe/snapshot-semantic.js +115 -0
- package/dist/observe/system-trace.js +22 -13
- package/dist/runtime/action-results.js +270 -0
- package/dist/runtime/clock.js +4 -0
- package/dist/server/common.js +1 -256
- package/dist/server/definitions/assert.js +162 -0
- package/dist/server/definitions/diagnostic.js +118 -0
- package/dist/server/definitions/input.js +274 -0
- package/dist/server/definitions/manage.js +194 -0
- package/dist/server/definitions/observe.js +149 -0
- package/dist/server/definitions/target.js +138 -0
- package/dist/server/definitions/wait.js +105 -0
- package/dist/server/handlers/action-execution.js +163 -0
- package/dist/server/handlers/correlation.js +23 -0
- package/dist/server/{debugger-handlers.js → handlers/debugger-handlers.js} +22 -12
- package/dist/server/handlers/debugger-response.js +9 -0
- package/dist/server/handlers/diagnostic.js +69 -0
- package/dist/server/handlers/handler-types.js +1 -0
- package/dist/server/handlers/input.js +154 -0
- package/dist/server/handlers/interact.js +113 -0
- package/dist/server/handlers/journey-assertions.js +35 -0
- package/dist/server/handlers/journey.js +147 -0
- package/dist/server/handlers/manage.js +119 -0
- package/dist/server/handlers/observe.js +95 -0
- package/dist/server/handlers/payload.js +4 -0
- package/dist/server/handlers/tool-handlers.js +160 -0
- package/dist/server/schemas/condition-schema.js +2 -0
- package/dist/server/{debugger-schema.js → schemas/debugger-schema.js} +11 -6
- package/dist/server/{journey-schema.js → schemas/journey-schema.js} +7 -22
- package/dist/server/tool-definitions.js +58 -1135
- package/dist/server-core.js +2 -2
- package/dist/system/android-status.js +101 -0
- package/dist/system/android.js +37 -27
- package/dist/system/index.js +13 -439
- package/dist/system/ios-status.js +132 -0
- package/dist/system/ios.js +11 -8
- package/dist/system/model.js +1 -0
- package/dist/system/probes.js +105 -0
- package/dist/system/status-summary.js +43 -0
- package/dist/system/unsupported-status.js +52 -0
- package/dist/utils/android/commands.js +89 -0
- package/dist/utils/android/gradle.js +139 -0
- package/dist/utils/android/logs.js +103 -0
- package/dist/utils/android/ui-tree.js +233 -0
- package/dist/utils/android/utils.js +6 -564
- package/dist/utils/cli/idb/idb-helper.js +4 -6
- package/dist/utils/cli/idb/install-idb.js +13 -9
- package/dist/utils/cli/ios/preflight-ios.js +42 -38
- package/dist/utils/ios/utils.js +45 -46
- package/dist/utils/java.js +65 -49
- package/dist/utils/resolve-device.js +4 -2
- package/dist/utils/ui/index.js +26 -26
- package/docs/CHANGELOG.md +44 -0
- package/docs/README.md +38 -0
- package/docs/benchmarks/README.md +18 -0
- package/docs/benchmarks/interaction-latency/README.md +14 -0
- package/docs/benchmarks/interaction-latency/final.md +4 -1
- package/docs/benchmarks/interaction-latency/ios-validation.md +2 -0
- package/docs/benchmarks/ui-tree-performance/README.md +24 -16
- package/docs/benchmarks/ui-tree-performance/comparison.md +11 -10
- package/docs/code-structure.md +118 -0
- package/docs/specs/001-state-verification/spec.md +16 -14
- package/docs/specs/002-richer-element-identity/spec.md +12 -10
- package/docs/specs/003-wait-and-synchronization-reliability/spec.md +12 -10
- package/docs/specs/004-action-verification-routing/spec.md +3 -3
- package/docs/specs/005-unified-action-execution-and-verification-model/spec.md +2 -0
- package/docs/specs/006-runtime-action-instrumentation-and-binding-layer/spec.md +2 -0
- package/docs/specs/007-actionability-resolution-and-executable-target-selection/spec.md +3 -1
- package/docs/specs/008-adjustable-control-support-and-semantic-value-manipulation/spec.md +3 -4
- package/docs/specs/009-semantic-control-modeling-for-custom-and-composite-controls/spec.md +2 -0
- package/docs/specs/010-verification-stabilization-and-temporal-convergence/spec.md +2 -2
- package/docs/specs/011-recovery-and-replanning-for-failed-or-ambiguous-interaction-flows/spec.md +2 -2
- package/docs/specs/011.1-recovery-contract-types-and-runtime-wiring-spec/spec.md +2 -0
- package/docs/specs/012-action-trace-and-xecution-observability/spec.md +2 -3
- package/docs/specs/013-wait-and-synchronization-reliability/spec.md +19 -19
- package/docs/specs/014-actionability-resolution/spec.md +20 -18
- package/docs/specs/015-adjustable-control-support/spec.md +17 -15
- package/docs/specs/016-environment-tools/spec.md +20 -20
- package/docs/specs/018-interaction-latency-and-batched-journeys/spec.md +2 -0
- package/docs/specs/019-ui-tree-observation-performance/spec.md +3 -1
- package/docs/specs/020-conditional-actions/intent.md +5 -3
- package/docs/specs/020-conditional-actions/plan.md +8 -9
- package/docs/specs/020-conditional-actions/spec.md +4 -2
- package/docs/specs/021-app-readiness-signals/intent.md +4 -2
- package/docs/specs/021-app-readiness-signals/plan.md +7 -6
- package/docs/specs/021-app-readiness-signals/spec.md +3 -1
- package/docs/specs/022-correlated-evidence/intent.md +4 -4
- package/docs/specs/022-correlated-evidence/plan.md +10 -11
- package/docs/specs/022-correlated-evidence/spec.md +3 -1
- package/docs/specs/023-android-system-traces/intent.md +3 -2
- package/docs/specs/023-android-system-traces/plan.md +5 -7
- package/docs/specs/023-android-system-traces/spec.md +3 -1
- package/docs/specs/024-android-heap-dump-capture/intent.md +3 -1
- package/docs/specs/025-android-runtime-debugger/intent.md +4 -3
- package/docs/specs/025-android-runtime-debugger/plan.md +3 -1
- package/docs/specs/025-android-runtime-debugger/spec.md +4 -3
- package/docs/specs/026-code-structure-and-quality-gates/health-plan.md +88 -0
- package/docs/specs/026-code-structure-and-quality-gates/intent.md +47 -0
- package/docs/specs/026-code-structure-and-quality-gates/plan.md +191 -0
- package/docs/specs/026-code-structure-and-quality-gates/spec.md +138 -0
- package/docs/specs/026-code-structure-and-quality-gates/verification-final.json +200 -0
- package/docs/specs/026-code-structure-and-quality-gates/verification-thin-facade.json +154 -0
- package/docs/specs/026-code-structure-and-quality-gates/verification.json +136 -0
- package/docs/specs/027-debugger-failure-diagnostics/intent.md +43 -0
- package/docs/specs/027-debugger-failure-diagnostics/plan.md +86 -0
- package/docs/specs/027-debugger-failure-diagnostics/spec.md +133 -0
- package/docs/specs/028-compact-debugger-responses/intent.md +41 -0
- package/docs/specs/028-compact-debugger-responses/plan.md +112 -0
- package/docs/specs/028-compact-debugger-responses/spec.md +108 -0
- package/docs/specs/029-kotlin-locals-validation/report.md +119 -0
- package/docs/specs/030-android-coroutine-validation/evidence.json +475 -0
- package/docs/specs/030-android-coroutine-validation/intent.md +47 -0
- package/docs/specs/030-android-coroutine-validation/plan.md +147 -0
- package/docs/specs/030-android-coroutine-validation/report.md +240 -0
- package/docs/specs/030-android-coroutine-validation/spec.md +107 -0
- package/docs/tools/TOOLS.md +31 -18
- package/docs/tools/{evidence.md → correlated-evidence.md} +9 -1
- package/docs/tools/debugger.md +76 -0
- package/docs/tools/interact.md +42 -20
- package/docs/tools/manage.md +25 -44
- package/docs/tools/observe.md +55 -23
- package/docs/tools/system-traces.md +9 -1
- package/docs/tools/system.md +12 -5
- package/package.json +11 -8
- package/scripts/architecture-graph.mjs +69 -0
- package/scripts/check-architecture.mjs +47 -0
- package/scripts/code-quality-baseline.json +1 -0
- package/scripts/code-quality.mjs +161 -0
- package/src/contracts/execution-controls.ts +26 -0
- package/src/contracts/selector.ts +17 -0
- package/src/contracts/target.ts +19 -0
- package/src/contracts/ui.ts +94 -0
- package/src/debugger/android.ts +2 -1
- package/src/debugger/diagnostics.ts +43 -0
- package/src/debugger/guard.ts +6 -1
- package/{worker → src/debugger/java}/DebuggerWorker.java +9 -3
- package/src/debugger/protocol.ts +37 -0
- package/src/debugger/sessions.ts +314 -155
- package/src/debugger/worker.ts +51 -38
- package/src/interact/adjustment/adjustment-context.ts +83 -0
- package/src/interact/adjustment/adjustment-gestures.ts +48 -0
- package/src/interact/adjustment/adjustment-plan.ts +23 -0
- package/src/interact/adjustment/adjustment-resolution.ts +104 -0
- package/src/interact/adjustment/adjustment-result.ts +34 -0
- package/src/interact/adjustment/adjustment-semantic.ts +53 -0
- package/src/interact/adjustment/adjustment-verification.ts +60 -0
- package/src/interact/adjustment/adjustment.ts +49 -0
- package/src/interact/adjustment/control-geometry.ts +120 -0
- package/src/interact/adjustment/control-values.ts +141 -0
- package/src/interact/adjustment/slider-labels.ts +84 -0
- package/src/interact/assertions/screen-assertion.ts +39 -0
- package/src/interact/assertions/state-assertion-context.ts +48 -0
- package/src/interact/assertions/state-assertion.ts +64 -0
- package/src/interact/assertions/state-comparison.ts +168 -0
- package/src/interact/assertions/visibility-assertion.ts +41 -0
- package/src/interact/conditional-action.ts +18 -12
- package/src/interact/index.ts +76 -3492
- package/src/interact/input-service.ts +11 -0
- package/src/interact/interaction-trace.ts +36 -0
- package/src/interact/model.ts +109 -0
- package/src/interact/observation.ts +7 -0
- package/src/interact/targeting/candidate-ancestor.ts +49 -0
- package/src/interact/targeting/candidate-result.ts +24 -0
- package/src/interact/targeting/candidate-scoring.ts +42 -0
- package/src/interact/targeting/element-helpers.ts +243 -0
- package/src/interact/targeting/find-element.ts +47 -0
- package/src/interact/targeting/nearby-control.ts +46 -0
- package/src/interact/targeting/resolved-elements.ts +20 -0
- package/src/interact/targeting/tap-target.ts +22 -0
- package/src/interact/targeting/target-scope.ts +121 -0
- package/src/interact/waits/legacy-log-wait.ts +30 -0
- package/src/interact/waits/legacy-wait-observations.ts +55 -0
- package/src/interact/waits/legacy-wait-state.ts +48 -0
- package/src/interact/waits/legacy-wait.ts +34 -0
- package/src/interact/waits/screen-wait.ts +37 -0
- package/src/interact/waits/ui-change-helpers.ts +184 -0
- package/src/interact/waits/ui-change-state.ts +26 -0
- package/src/interact/waits/ui-change-wait.ts +59 -0
- package/src/interact/waits/ui-wait-condition.ts +52 -0
- package/src/interact/waits/ui-wait-state.ts +55 -0
- package/src/interact/waits/ui-wait.ts +84 -0
- package/src/manage/android.ts +56 -50
- package/src/manage/index.ts +63 -93
- package/src/manage/ios/build-types.ts +14 -0
- package/src/manage/ios/build.ts +230 -0
- package/src/manage/ios/project-discovery.ts +26 -0
- package/src/manage/ios/scheme.ts +16 -0
- package/src/manage/ios.ts +65 -298
- package/src/observe/android/context.ts +1 -0
- package/src/observe/android/current-screen.ts +63 -0
- package/src/observe/android/fingerprint.ts +13 -0
- package/src/observe/android/log-stream.ts +127 -0
- package/src/observe/android/logs.ts +110 -0
- package/src/observe/android/screenshot.ts +79 -0
- package/src/observe/android/ui-tree.ts +113 -0
- package/src/observe/android.ts +17 -531
- package/src/observe/evidence.ts +122 -70
- package/src/observe/index.ts +24 -286
- package/src/observe/ios/context.ts +22 -0
- package/src/observe/ios/fingerprint.ts +12 -0
- package/src/observe/ios/log-stream.ts +103 -0
- package/src/observe/ios/logs.ts +179 -0
- package/src/observe/ios/screenshot.ts +26 -0
- package/src/observe/ios/ui-elements.ts +266 -0
- package/src/observe/ios/ui-tree.ts +143 -0
- package/src/observe/ios.ts +18 -749
- package/src/observe/logs/model.ts +11 -0
- package/src/{network → observe/network}/index.ts +2 -2
- package/src/observe/readiness-service.ts +5 -3
- package/src/observe/readiness.ts +39 -18
- package/src/observe/screenshot-encoding.ts +32 -0
- package/src/observe/snapshot-collection.ts +69 -0
- package/src/observe/snapshot-logs.ts +26 -0
- package/src/observe/snapshot-metadata.ts +51 -31
- package/src/observe/snapshot-semantic.ts +153 -0
- package/src/observe/system-trace.ts +24 -15
- package/src/runtime/action-results.ts +376 -0
- package/src/runtime/clock.ts +9 -0
- package/src/server/common.ts +9 -359
- package/src/server/definitions/assert.ts +164 -0
- package/src/server/definitions/diagnostic.ts +120 -0
- package/src/server/definitions/input.ts +276 -0
- package/src/server/definitions/manage.ts +196 -0
- package/src/server/definitions/observe.ts +151 -0
- package/src/server/definitions/target.ts +140 -0
- package/src/server/definitions/wait.ts +107 -0
- package/src/server/handlers/action-execution.ts +164 -0
- package/src/server/handlers/correlation.ts +20 -0
- package/src/server/handlers/debugger-handlers.ts +39 -0
- package/src/server/handlers/debugger-response.ts +7 -0
- package/src/server/handlers/diagnostic.ts +79 -0
- package/src/server/handlers/handler-types.ts +7 -0
- package/src/server/handlers/input.ts +173 -0
- package/src/server/handlers/interact.ts +135 -0
- package/src/server/handlers/journey-assertions.ts +39 -0
- package/src/server/handlers/journey.ts +132 -0
- package/src/server/handlers/manage.ts +141 -0
- package/src/server/handlers/observe.ts +116 -0
- package/src/server/handlers/payload.ts +36 -0
- package/src/server/handlers/tool-handlers.ts +159 -0
- package/src/server/schemas/condition-schema.ts +2 -0
- package/src/server/{debugger-schema.ts → schemas/debugger-schema.ts} +13 -7
- package/src/server/{journey-schema.ts → schemas/journey-schema.ts} +7 -22
- package/src/server/{system-trace-schema.ts → schemas/system-trace-schema.ts} +3 -3
- package/src/server/tool-definitions.ts +67 -1143
- package/src/server-core.ts +2 -2
- package/src/server.ts +1 -1
- package/src/system/android-status.ts +124 -0
- package/src/system/android.ts +33 -21
- package/src/system/index.ts +21 -525
- package/src/system/ios-status.ts +147 -0
- package/src/system/ios.ts +14 -10
- package/src/system/model.ts +41 -0
- package/src/system/probes.ts +114 -0
- package/src/system/status-summary.ts +47 -0
- package/src/system/unsupported-status.ts +55 -0
- package/src/types.ts +16 -106
- package/src/utils/android/commands.ts +81 -0
- package/src/utils/android/gradle.ts +132 -0
- package/src/utils/android/logs.ts +103 -0
- package/src/utils/android/ui-tree.ts +239 -0
- package/src/utils/android/utils.ts +16 -556
- package/src/utils/cli/idb/check-idb.ts +4 -4
- package/src/utils/cli/idb/idb-helper.ts +6 -8
- package/src/utils/cli/idb/install-idb.ts +15 -9
- package/src/utils/cli/ios/preflight-ios.ts +39 -31
- package/src/utils/cli/ios/run-ios-ui-tree-tap.ts +4 -4
- package/src/utils/ios/utils.ts +57 -61
- package/src/utils/java.ts +62 -43
- package/src/utils/resolve-device.ts +9 -6
- package/src/utils/ui/index.ts +28 -28
- package/test/device/automated/debugger/coroutine-lifecycle.ts +27 -0
- package/test/device/automated/debugger/coroutine-support.ts +140 -0
- package/test/device/automated/debugger/coroutine.android.test.ts +169 -0
- package/test/device/automated/debugger/kotlin.android.test.ts +127 -0
- package/test/device/automated/debugger/runtime.android.test.ts +19 -3
- package/test/device/automated/interact/interaction.android.test.ts +56 -0
- package/test/device/automated/observe/system-trace.smoke.ts +1 -1
- package/test/device/manual/interact/modul8_selector_tap.manual.ts +1 -1
- package/test/fixtures/contracts/tool-definitions.json +3536 -0
- package/test/fixtures/coroutine-app/MainActivity.kt +100 -0
- package/test/fixtures/coroutine-app/README.md +48 -0
- package/test/fixtures/coroutine-app/build.ts +35 -0
- package/test/fixtures/debugger-app/MainActivity.java +21 -0
- package/test/fixtures/debugger-app/MainActivity.kt +32 -0
- package/test/fixtures/debugger-app/README.md +52 -0
- package/test/fixtures/debugger-app/build.ts +25 -15
- package/test/fixtures/latency-journey-app/README.md +2 -0
- package/test/fixtures/readiness-app/README.md +2 -0
- package/test/unit/debugger/coroutine-lifecycle.test.ts +43 -0
- package/test/unit/debugger/diagnostic-sessions.test.ts +67 -0
- package/test/unit/debugger/diagnostics.test.ts +80 -0
- package/test/unit/debugger/guards.test.ts +4 -0
- package/test/unit/debugger/preparation.test.ts +32 -0
- package/test/unit/debugger/protocol.test.ts +15 -0
- package/test/unit/debugger/sessions.test.ts +1 -1
- package/test/unit/interact/adjustment_service.test.ts +42 -0
- package/test/unit/interact/adjustment_verification.test.ts +35 -0
- package/test/unit/interact/clock_dependencies.test.ts +63 -0
- package/test/unit/interact/element_helpers.test.ts +19 -0
- package/test/unit/interact/legacy_wait_service.test.ts +17 -0
- package/test/unit/interact/state_comparison.test.ts +20 -0
- package/test/unit/interact/target_scope.test.ts +35 -0
- package/test/unit/network/get_network_activity.test.ts +1 -1
- package/test/unit/observe/screenshot-encoding.test.ts +30 -0
- package/test/unit/observe/snapshot-logs.test.ts +14 -0
- package/test/unit/quality/architecture.test.ts +60 -0
- package/test/unit/quality/code-quality.test.ts +58 -0
- package/test/unit/quality/interaction_boundaries.test.ts +24 -0
- package/test/unit/server/conditional_actions.test.ts +1 -1
- package/test/unit/server/conditional_schema.test.ts +2 -2
- package/test/unit/server/debugger-response.test.ts +63 -0
- package/test/unit/server/tool_definitions_parity.test.ts +8 -0
- package/dist/server/tool-handlers.js +0 -1000
- package/docs/ROADMAP.md +0 -646
- package/docs/benchmarks/ui-tree-performance/bridge-probe.json +0 -29
- package/docs/benchmarks/ui-tree-performance/initial-baseline.json +0 -59560
- package/docs/specs/baseline-spec-v0.md +0 -312
- package/docs/specs/mcp-tooling-spec-v1.md +0 -446
- package/src/server/debugger-handlers.ts +0 -29
- package/src/server/tool-handlers.ts +0 -1008
- /package/dist/{server/condition-schema.js → contracts/condition.js} +0 -0
- /package/dist/server/{readiness-schema.js → schemas/readiness-schema.js} +0 -0
- /package/dist/server/{system-trace-schema.js → schemas/system-trace-schema.js} +0 -0
- /package/src/{server/condition-schema.ts → contracts/condition.ts} +0 -0
- /package/src/server/{readiness-schema.ts → schemas/readiness-schema.ts} +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export const assertTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'expect_screen',
|
|
4
|
+
description: `Purpose:
|
|
5
|
+
Deterministically verify that the intended navigation outcome of an action has occurred.
|
|
6
|
+
|
|
7
|
+
Inputs:
|
|
8
|
+
- fingerprint: preferred exact-match screen fingerprint
|
|
9
|
+
- screen: exact semantic screen identifier when a fingerprint is not available
|
|
10
|
+
|
|
11
|
+
Output Structure:
|
|
12
|
+
- success: true when the expected screen matches the observed screen
|
|
13
|
+
- observed_screen: current fingerprint and screen identifier
|
|
14
|
+
- expected_screen: the expected fingerprint and/or screen identifier
|
|
15
|
+
- confidence: 1 for an exact match, otherwise 0
|
|
16
|
+
|
|
17
|
+
Recommended Usage:
|
|
18
|
+
1. Define the expected screen before executing the action
|
|
19
|
+
2. Resolve the target element or screen state
|
|
20
|
+
3. Call an action tool such as tap_element
|
|
21
|
+
4. If needed, wait for transition using wait_for_*
|
|
22
|
+
5. Call expect_screen as the final verification step
|
|
23
|
+
6. If success=false, treat the outcome as unverified and follow the action tool retry guidance
|
|
24
|
+
|
|
25
|
+
Verification Guidance:
|
|
26
|
+
- Primary and authoritative verification tool for navigation outcomes
|
|
27
|
+
- Prefer fingerprint whenever you have one
|
|
28
|
+
- Use screen only as a fallback exact match against known identifiers
|
|
29
|
+
- Works best when the expected screen identifier is known ahead of time
|
|
30
|
+
- If the expected screen is not already known, capture or define it before executing the action
|
|
31
|
+
|
|
32
|
+
Constraints:
|
|
33
|
+
- Returns structured binary success/failure only
|
|
34
|
+
- Must not rely on natural-language interpretation or reasoning
|
|
35
|
+
|
|
36
|
+
Failure Handling:
|
|
37
|
+
- success=false means the expected screen was not reached; retry or recover using the action tool's failure strategy`,
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {
|
|
41
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Optional platform override (android|ios)' },
|
|
42
|
+
fingerprint: { type: 'string', description: 'Expected screen fingerprint. Preferred verification mechanism.' },
|
|
43
|
+
screen: { type: 'string', description: 'Expected exact screen identifier when no fingerprint is available.' },
|
|
44
|
+
deviceId: { type: 'string', description: 'Optional device id/udid to target' }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'expect_element_visible',
|
|
50
|
+
description: `Purpose:
|
|
51
|
+
Deterministically verify that the intended UI outcome of an action has occurred by confirming a target element is visible.
|
|
52
|
+
|
|
53
|
+
Inputs:
|
|
54
|
+
- selector: required selector used to resolve the target element
|
|
55
|
+
- element_id: optional previously resolved element identifier used only as context
|
|
56
|
+
|
|
57
|
+
Output Structure:
|
|
58
|
+
- success: true when the element is visible
|
|
59
|
+
- selector: selector used for verification
|
|
60
|
+
- element_id: resolved element identifier when available
|
|
61
|
+
- element: minimal resolved element info when visible
|
|
62
|
+
- failure_code: TIMEOUT or UNKNOWN when verification fails
|
|
63
|
+
- retryable: true when failure_code=TIMEOUT
|
|
64
|
+
|
|
65
|
+
Recommended Usage:
|
|
66
|
+
1. Define the expected element state before executing the action
|
|
67
|
+
2. Resolve the target element or triggering control
|
|
68
|
+
3. Call an action tool such as tap_element
|
|
69
|
+
4. If needed, wait for UI availability using wait_for_*
|
|
70
|
+
5. Call expect_element_visible as the final verification step
|
|
71
|
+
6. If success=false, follow the action tool retry guidance
|
|
72
|
+
|
|
73
|
+
Verification Guidance:
|
|
74
|
+
- Primary and authoritative verification tool for expected element appearance or visibility
|
|
75
|
+
- Use this when the screen should stay the same but the UI should reveal or update a specific element
|
|
76
|
+
- selector is the primary input; element_id is an optional optimization only
|
|
77
|
+
- The tool resolves the selector internally when needed
|
|
78
|
+
|
|
79
|
+
Constraints:
|
|
80
|
+
- Returns structured binary success/failure only
|
|
81
|
+
- Must not rely on natural-language interpretation or reasoning
|
|
82
|
+
|
|
83
|
+
Failure Handling:
|
|
84
|
+
- TIMEOUT → retry verification once or retry the action after re-resolving
|
|
85
|
+
- UNKNOWN → capture a snapshot and stop`,
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: 'object',
|
|
88
|
+
properties: {
|
|
89
|
+
selector: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
properties: {
|
|
92
|
+
text: { type: 'string' },
|
|
93
|
+
resource_id: { type: 'string' },
|
|
94
|
+
accessibility_id: { type: 'string' },
|
|
95
|
+
contains: { type: 'boolean', default: false }
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
element_id: { type: 'string', description: 'Optional previously resolved element identifier.' },
|
|
99
|
+
timeout_ms: { type: 'number', default: 5000 },
|
|
100
|
+
poll_interval_ms: { type: 'number', default: 300 },
|
|
101
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Optional platform override' },
|
|
102
|
+
deviceId: { type: 'string', description: 'Optional device serial/udid' }
|
|
103
|
+
},
|
|
104
|
+
required: ['selector']
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'expect_state',
|
|
109
|
+
description: `Purpose:
|
|
110
|
+
Verify a readable UI state property on the currently visible element.
|
|
111
|
+
|
|
112
|
+
Inputs:
|
|
113
|
+
- selector or element_id
|
|
114
|
+
- property
|
|
115
|
+
- expected
|
|
116
|
+
- platform/deviceId (optional)
|
|
117
|
+
|
|
118
|
+
Supported properties:
|
|
119
|
+
- checked, selected, focused, expanded, enabled, text_value, value, raw_value
|
|
120
|
+
|
|
121
|
+
Verification Guidance:
|
|
122
|
+
- Use this when the UI element is visible but its state must also be confirmed
|
|
123
|
+
- Prefer the canonical property names above
|
|
124
|
+
- The tool compares the normalized readable state and returns the observed value when available
|
|
125
|
+
|
|
126
|
+
Constraints:
|
|
127
|
+
- Returns structured success/failure only
|
|
128
|
+
- Does not infer a state when the property is unavailable
|
|
129
|
+
|
|
130
|
+
Failure Handling:
|
|
131
|
+
- ELEMENT_NOT_FOUND → re-resolve the element or wait for UI stabilization
|
|
132
|
+
- UNKNOWN → capture a snapshot and stop`,
|
|
133
|
+
inputSchema: {
|
|
134
|
+
type: 'object',
|
|
135
|
+
properties: {
|
|
136
|
+
selector: {
|
|
137
|
+
type: 'object',
|
|
138
|
+
properties: {
|
|
139
|
+
text: { type: 'string' },
|
|
140
|
+
resource_id: { type: 'string' },
|
|
141
|
+
accessibility_id: { type: 'string' },
|
|
142
|
+
contains: { type: 'boolean', default: false }
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
element_id: { type: 'string', description: 'Optional previously resolved element identifier.' },
|
|
146
|
+
property: { type: 'string', description: 'Readable state property to verify.' },
|
|
147
|
+
expected: {
|
|
148
|
+
description: 'Expected normalized state value.',
|
|
149
|
+
oneOf: [
|
|
150
|
+
{ type: 'boolean' },
|
|
151
|
+
{ type: 'number' },
|
|
152
|
+
{ type: 'string' },
|
|
153
|
+
{ type: 'object' }
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Optional platform override' },
|
|
157
|
+
deviceId: { type: 'string', description: 'Optional device serial/udid' }
|
|
158
|
+
},
|
|
159
|
+
required: ['property', 'expected']
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
];
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export const diagnosticTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'get_system_status',
|
|
4
|
+
description: 'Quick healthcheck of local mobile debugging environment (adb, devices, logs, env, iOS).',
|
|
5
|
+
inputSchema: { type: 'object', properties: {} }
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'classify_action_outcome',
|
|
9
|
+
description: `Classify the outcome of the most recent action into exactly one of: success, no_op, backend_failure, ui_failure, unknown.
|
|
10
|
+
|
|
11
|
+
Use the runtime action result's \`action_type\` as \`actionType\` so the classifier can distinguish local-state actions from side-effect actions.
|
|
12
|
+
Use this when the intended outcome is not already fully verified by the UI signal alone.
|
|
13
|
+
For backend/API activity, compare get_screen_fingerprint before and after the action and call get_network_activity immediately after the action if the outcome is still ambiguous.
|
|
14
|
+
|
|
15
|
+
HOW TO GATHER INPUTS before calling:
|
|
16
|
+
1. Call wait_for_screen_change or compare get_screen_fingerprint before/after — set uiChanged accordingly.
|
|
17
|
+
2. If you checked for a specific element with wait_for_ui, set expectedElementVisible.
|
|
18
|
+
3. Pass actionType from the action response when available.
|
|
19
|
+
4. Only provide networkRequests if you already collected them or want to classify a side-effect action with backend evidence.
|
|
20
|
+
|
|
21
|
+
RULES (applied in order — stop at first match):
|
|
22
|
+
1. If uiChanged=true OR expectedElementVisible=true → outcome=success
|
|
23
|
+
2. If actionType is missing → outcome=unknown
|
|
24
|
+
3. If any request has status=failure or retryable → outcome=backend_failure
|
|
25
|
+
4. If actionType maps to a local-state action → outcome=no_op; prefer state-based verification and avoid default network fallback
|
|
26
|
+
5. If actionType maps to a side-effect action and no networkRequests were supplied → outcome=unknown
|
|
27
|
+
6. If no requests returned → outcome=no_op
|
|
28
|
+
7. If all requests succeeded → outcome=ui_failure
|
|
29
|
+
8. Otherwise → outcome=unknown
|
|
30
|
+
|
|
31
|
+
BEHAVIOUR after outcome:
|
|
32
|
+
- success → continue
|
|
33
|
+
- no_op → retry with richer state verification or re-resolve the element
|
|
34
|
+
- backend_failure → stop and report the failing endpoint
|
|
35
|
+
- ui_failure → stop and report failure
|
|
36
|
+
- unknown → take one recovery step (e.g. capture_debug_snapshot), then stop`,
|
|
37
|
+
inputSchema: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
uiChanged: {
|
|
41
|
+
type: 'boolean',
|
|
42
|
+
description: 'true if the screen fingerprint or activity changed after the action. Use wait_for_screen_change or compare get_screen_fingerprint before and after.'
|
|
43
|
+
},
|
|
44
|
+
expectedElementVisible: {
|
|
45
|
+
type: 'boolean',
|
|
46
|
+
description: 'true if the element you expected to appear is now visible (from wait_for_ui). Omit if you did not check for a specific element.'
|
|
47
|
+
},
|
|
48
|
+
actionType: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
description: 'The runtime action_type from the action response (for example tap, tap_element, swipe, type_text, press_back, start_app).'
|
|
51
|
+
},
|
|
52
|
+
networkRequests: {
|
|
53
|
+
type: 'array',
|
|
54
|
+
description: 'Optional network evidence collected after the action. Use it when the expected outcome is backend/API activity or when the UI signal is ambiguous.',
|
|
55
|
+
items: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
endpoint: { type: 'string', description: 'Request endpoint or full URL' },
|
|
59
|
+
status: { type: 'string', enum: ['success', 'failure', 'retryable'], description: 'Outcome of the request' }
|
|
60
|
+
},
|
|
61
|
+
required: ['endpoint', 'status']
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
hasLogErrors: {
|
|
65
|
+
type: 'boolean',
|
|
66
|
+
description: 'true if structured log errors were observed (e.g. from read_log_stream). Optional — include if you have already read logs.'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
required: ['uiChanged']
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'run_journey',
|
|
74
|
+
description: 'Run an ordered, bounded sequence of start_app, tap, wait, and deterministic assertion steps against one device. Stops after the first failed step.',
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
platform: { type: 'string', enum: ['android', 'ios'] },
|
|
79
|
+
deviceId: { type: 'string' },
|
|
80
|
+
responseMode: { type: 'string', enum: ['compact', 'debug'], default: 'compact' },
|
|
81
|
+
steps: { type: 'array', minItems: 1, maxItems: 50, items: { type: 'object', properties: { id: { type: 'string' }, type: { type: 'string', enum: ['start_app', 'tap', 'wait', 'assert'] } }, required: ['id', 'type'] } }
|
|
82
|
+
},
|
|
83
|
+
required: ['platform', 'steps']
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'get_network_activity',
|
|
88
|
+
description: `Returns structured network events captured from platform logs since the last action.
|
|
89
|
+
|
|
90
|
+
Call this immediately after an action when you want backend evidence for a side-effect flow, only if the result is still ambiguous.
|
|
91
|
+
Do not call more than once per action.
|
|
92
|
+
|
|
93
|
+
Events are filtered to significant (non-background) requests only.
|
|
94
|
+
Each event includes endpoint, method, statusCode, networkError, status, and durationMs.
|
|
95
|
+
|
|
96
|
+
status values:
|
|
97
|
+
- success: HTTP 2xx or request detected with no error signal
|
|
98
|
+
- failure: HTTP 4xx
|
|
99
|
+
- retryable: HTTP 5xx, network error (timeout, dns_error, tls_error, etc.)
|
|
100
|
+
|
|
101
|
+
Returns { requests: [], count: 0 } when no credible network signals are found.`,
|
|
102
|
+
inputSchema: {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties: {
|
|
105
|
+
platform: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
enum: ['android', 'ios'],
|
|
108
|
+
description: 'Platform to read network logs from'
|
|
109
|
+
},
|
|
110
|
+
deviceId: {
|
|
111
|
+
type: 'string',
|
|
112
|
+
description: 'Device Serial (Android) or UDID (iOS). Defaults to connected/booted device.'
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
required: ['platform']
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
];
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { verificationModeJson, responseModeJson } from '../../contracts/execution-controls.js';
|
|
2
|
+
export const inputTools = [
|
|
3
|
+
{
|
|
4
|
+
name: 'tap',
|
|
5
|
+
description: `Purpose:
|
|
6
|
+
Dispatch a tap at specific screen coordinates.
|
|
7
|
+
|
|
8
|
+
Inputs:
|
|
9
|
+
- x, y coordinates
|
|
10
|
+
- platform (optional)
|
|
11
|
+
- deviceId (optional)
|
|
12
|
+
|
|
13
|
+
Output Structure:
|
|
14
|
+
- action_id, timestamp (ISO 8601), action_type
|
|
15
|
+
- lifecycle_state: post-dispatch lifecycle state (pending_verification or failed)
|
|
16
|
+
- source_module: runtime source of the action envelope
|
|
17
|
+
- target.selector = { x, y }
|
|
18
|
+
- success = true when the tap was dispatched
|
|
19
|
+
- failure_code/retryable when dispatch fails
|
|
20
|
+
- ui_fingerprint_before/ui_fingerprint_after when available
|
|
21
|
+
|
|
22
|
+
Recommended Usage:
|
|
23
|
+
1. Resolve coordinates deterministically
|
|
24
|
+
2. Call tap
|
|
25
|
+
3. If needed, wait for transition using wait_for_*
|
|
26
|
+
4. Verify with expect_screen or expect_element_visible depending on the intended outcome
|
|
27
|
+
|
|
28
|
+
Verification Guidance:
|
|
29
|
+
- Prefer tap_element over tap when an element can be resolved
|
|
30
|
+
- Follow RESOLVE → ACT → WAIT (if needed) → EXPECT
|
|
31
|
+
- Use expect_screen for navigation and expect_element_visible for local UI changes
|
|
32
|
+
- Do not use wait_for_* alone as final verification when an applicable expect_* tool exists
|
|
33
|
+
|
|
34
|
+
Failure Handling:
|
|
35
|
+
- TIMEOUT → retry once
|
|
36
|
+
- UNKNOWN → capture a snapshot and stop`,
|
|
37
|
+
inputSchema: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
platform: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
enum: ['android', 'ios'],
|
|
43
|
+
description: 'Platform to tap on'
|
|
44
|
+
},
|
|
45
|
+
x: {
|
|
46
|
+
type: 'number',
|
|
47
|
+
description: 'X coordinate'
|
|
48
|
+
},
|
|
49
|
+
y: {
|
|
50
|
+
type: 'number',
|
|
51
|
+
description: 'Y coordinate'
|
|
52
|
+
},
|
|
53
|
+
deviceId: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
description: 'Device Serial/UDID. Defaults to connected/booted device.'
|
|
56
|
+
},
|
|
57
|
+
verificationMode: { ...verificationModeJson, default: 'full' },
|
|
58
|
+
responseMode: { ...responseModeJson, default: 'debug' },
|
|
59
|
+
actionTimeoutMs: { type: 'number', minimum: 100, maximum: 30000 },
|
|
60
|
+
verificationTimeoutMs: { type: 'number', minimum: 100, maximum: 60000 }
|
|
61
|
+
},
|
|
62
|
+
required: ['x', 'y']
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'swipe',
|
|
67
|
+
description: `Purpose:
|
|
68
|
+
Dispatch a swipe gesture on Android or iOS.
|
|
69
|
+
|
|
70
|
+
Inputs:
|
|
71
|
+
- start and end coordinates
|
|
72
|
+
- duration
|
|
73
|
+
- platform/deviceId (optional)
|
|
74
|
+
|
|
75
|
+
Output Structure:
|
|
76
|
+
- action_id, timestamp (ISO 8601), action_type
|
|
77
|
+
- lifecycle_state: post-dispatch lifecycle state (pending_verification or failed)
|
|
78
|
+
- source_module: runtime source of the action envelope
|
|
79
|
+
- target.selector = { x1, y1, x2, y2, duration }
|
|
80
|
+
- success = true when the swipe was dispatched
|
|
81
|
+
- failure_code/retryable when dispatch fails
|
|
82
|
+
- ui_fingerprint_before/ui_fingerprint_after when available
|
|
83
|
+
|
|
84
|
+
Recommended Usage:
|
|
85
|
+
1. Determine swipe coordinates
|
|
86
|
+
2. Call swipe
|
|
87
|
+
3. If needed, wait for transition using wait_for_*
|
|
88
|
+
4. Verify with expect_screen or expect_element_visible when a deterministic outcome is expected
|
|
89
|
+
|
|
90
|
+
Verification Guidance:
|
|
91
|
+
- Swipe outcomes are less predictable; choose the most specific verifier available for the intended effect
|
|
92
|
+
- Follow RESOLVE → ACT → WAIT (if needed) → EXPECT
|
|
93
|
+
- Do not use wait_for_* alone as final verification when an applicable expect_* tool exists
|
|
94
|
+
|
|
95
|
+
Failure Handling:
|
|
96
|
+
- TIMEOUT → retry once
|
|
97
|
+
- UNKNOWN → capture a snapshot and stop`,
|
|
98
|
+
inputSchema: {
|
|
99
|
+
type: 'object',
|
|
100
|
+
properties: {
|
|
101
|
+
platform: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
enum: ['android', 'ios'],
|
|
104
|
+
description: 'Platform to swipe on (android or ios)'
|
|
105
|
+
},
|
|
106
|
+
x1: { type: 'number', description: 'Start X coordinate' },
|
|
107
|
+
y1: { type: 'number', description: 'Start Y coordinate' },
|
|
108
|
+
x2: { type: 'number', description: 'End X coordinate' },
|
|
109
|
+
y2: { type: 'number', description: 'End Y coordinate' },
|
|
110
|
+
duration: { type: 'number', description: 'Duration in ms' },
|
|
111
|
+
deviceId: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
description: 'Device Serial/UDID. Defaults to connected/booted device.'
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
required: ['x1', 'y1', 'x2', 'y2', 'duration']
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'scroll_to_element',
|
|
121
|
+
description: `Purpose:
|
|
122
|
+
Scroll until a target element becomes visible.
|
|
123
|
+
|
|
124
|
+
Inputs:
|
|
125
|
+
- platform
|
|
126
|
+
- selector
|
|
127
|
+
- direction, maxScrolls, scrollAmount, deviceId (optional)
|
|
128
|
+
|
|
129
|
+
Output Structure:
|
|
130
|
+
- action_id, timestamp (ISO 8601), action_type
|
|
131
|
+
- lifecycle_state: post-dispatch lifecycle state (pending_verification or failed)
|
|
132
|
+
- source_module: runtime source of the action envelope
|
|
133
|
+
- target.selector = original selector
|
|
134
|
+
- target.resolved = minimal resolved element info when found
|
|
135
|
+
- success = true when scrolling produced a visible target element
|
|
136
|
+
- failure_code/retryable when the target was not reached
|
|
137
|
+
- ui_fingerprint_before/ui_fingerprint_after when available
|
|
138
|
+
|
|
139
|
+
Recommended Usage:
|
|
140
|
+
1. Resolve the target selector
|
|
141
|
+
2. Call scroll_to_element
|
|
142
|
+
3. If needed, wait for UI stabilization using wait_for_*
|
|
143
|
+
4. Verify with expect_element_visible when the expected element visibility is known
|
|
144
|
+
5. If success=false, follow failure handling before retrying
|
|
145
|
+
|
|
146
|
+
Verification Guidance:
|
|
147
|
+
- Follow RESOLVE → ACT → WAIT (if needed) → EXPECT
|
|
148
|
+
- Use expect_element_visible when you need an explicit post-scroll confirmation
|
|
149
|
+
- Do not use wait_for_* alone as final verification when an applicable expect_* tool exists
|
|
150
|
+
|
|
151
|
+
Failure Handling:
|
|
152
|
+
- NAVIGATION_NO_CHANGE → adjust scroll direction or stop
|
|
153
|
+
- TIMEOUT → retry with refined selector or larger scroll budget
|
|
154
|
+
- UNKNOWN → capture a snapshot and stop`,
|
|
155
|
+
inputSchema: {
|
|
156
|
+
type: 'object',
|
|
157
|
+
properties: {
|
|
158
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Platform to operate on (required)' },
|
|
159
|
+
selector: {
|
|
160
|
+
type: 'object',
|
|
161
|
+
properties: {
|
|
162
|
+
text: { type: 'string' },
|
|
163
|
+
resourceId: { type: 'string' },
|
|
164
|
+
contentDesc: { type: 'string' },
|
|
165
|
+
className: { type: 'string' }
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
direction: { type: 'string', enum: ['down', 'up'], default: 'down' },
|
|
169
|
+
maxScrolls: { type: 'number', default: 10 },
|
|
170
|
+
scrollAmount: { type: 'number', default: 0.7 },
|
|
171
|
+
deviceId: { type: 'string', description: 'Device UDID (iOS) or Serial (Android). Defaults to booted/connected.' }
|
|
172
|
+
},
|
|
173
|
+
required: ['platform', 'selector']
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: 'type_text',
|
|
178
|
+
description: `Purpose:
|
|
179
|
+
Type text into the currently focused Android input field.
|
|
180
|
+
|
|
181
|
+
Inputs:
|
|
182
|
+
- text
|
|
183
|
+
- platform/deviceId (optional)
|
|
184
|
+
|
|
185
|
+
Output Structure:
|
|
186
|
+
- action_id, timestamp (ISO 8601), action_type
|
|
187
|
+
- lifecycle_state: post-dispatch lifecycle state (pending_verification or failed)
|
|
188
|
+
- source_module: runtime source of the action envelope
|
|
189
|
+
- target.selector = { text }
|
|
190
|
+
- success = true when text input was dispatched
|
|
191
|
+
- failure_code/retryable when dispatch fails
|
|
192
|
+
- ui_fingerprint_before/ui_fingerprint_after when available
|
|
193
|
+
|
|
194
|
+
Recommended Usage:
|
|
195
|
+
1. Resolve or focus the target input first
|
|
196
|
+
2. Call type_text
|
|
197
|
+
3. If needed, wait for UI stabilization using wait_for_*
|
|
198
|
+
4. Verify with expect_element_visible or expect_screen, depending on the intended outcome
|
|
199
|
+
|
|
200
|
+
Verification Guidance:
|
|
201
|
+
- Prefer verifying the next expected element or screen state instead of inferring success from the text action alone
|
|
202
|
+
- Follow RESOLVE → ACT → WAIT (if needed) → EXPECT
|
|
203
|
+
- Do not use wait_for_* alone as final verification when an applicable expect_* tool exists
|
|
204
|
+
|
|
205
|
+
Failure Handling:
|
|
206
|
+
- TIMEOUT → retry once
|
|
207
|
+
- UNKNOWN → re-focus the input or capture a snapshot`,
|
|
208
|
+
inputSchema: {
|
|
209
|
+
type: 'object',
|
|
210
|
+
properties: {
|
|
211
|
+
platform: {
|
|
212
|
+
type: 'string',
|
|
213
|
+
enum: ['android'],
|
|
214
|
+
description: 'Platform to type on (currently only android supported)'
|
|
215
|
+
},
|
|
216
|
+
text: {
|
|
217
|
+
type: 'string',
|
|
218
|
+
description: 'The text to type'
|
|
219
|
+
},
|
|
220
|
+
deviceId: {
|
|
221
|
+
type: 'string',
|
|
222
|
+
description: 'Device Serial/UDID. Defaults to connected/booted device.'
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
required: ['text']
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: 'press_back',
|
|
230
|
+
description: `Purpose:
|
|
231
|
+
Dispatch the Android Back action.
|
|
232
|
+
|
|
233
|
+
Inputs:
|
|
234
|
+
- platform/deviceId (optional)
|
|
235
|
+
|
|
236
|
+
Output Structure:
|
|
237
|
+
- action_id, timestamp (ISO 8601), action_type
|
|
238
|
+
- lifecycle_state: post-dispatch lifecycle state (pending_verification or failed)
|
|
239
|
+
- source_module: runtime source of the action envelope
|
|
240
|
+
- target.selector = { key: "back" }
|
|
241
|
+
- success = true when the back action was dispatched
|
|
242
|
+
- failure_code/retryable when dispatch fails
|
|
243
|
+
- ui_fingerprint_before/ui_fingerprint_after when available
|
|
244
|
+
|
|
245
|
+
Recommended Usage:
|
|
246
|
+
1. Call press_back
|
|
247
|
+
2. If needed, wait for transition using wait_for_*
|
|
248
|
+
3. Verify with expect_screen when a known destination is expected
|
|
249
|
+
4. If verification fails, retry once or recover explicitly
|
|
250
|
+
|
|
251
|
+
Verification Guidance:
|
|
252
|
+
- Back outcomes can vary by screen, so verify against the intended destination when possible
|
|
253
|
+
- Follow RESOLVE → ACT → WAIT (if needed) → EXPECT
|
|
254
|
+
- Do not use wait_for_* alone as final verification when an applicable expect_* tool exists
|
|
255
|
+
|
|
256
|
+
Failure Handling:
|
|
257
|
+
- TIMEOUT → retry once
|
|
258
|
+
- UNKNOWN → capture a snapshot and stop`,
|
|
259
|
+
inputSchema: {
|
|
260
|
+
type: 'object',
|
|
261
|
+
properties: {
|
|
262
|
+
platform: {
|
|
263
|
+
type: 'string',
|
|
264
|
+
enum: ['android'],
|
|
265
|
+
description: 'Platform (currently only android supported)'
|
|
266
|
+
},
|
|
267
|
+
deviceId: {
|
|
268
|
+
type: 'string',
|
|
269
|
+
description: 'Device Serial/UDID. Defaults to connected/booted device.'
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
];
|