mobile-debug-mcp 0.33.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 +23 -2
- package/AGENTS.md +12 -3
- package/CONTRIBUTING.md +79 -0
- package/README.md +158 -124
- 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 +20 -6
- package/agent-plugin/mcp.json +1 -1
- package/agent-plugin/plugin.json +1 -1
- package/agent-plugin/skills/mobile-debug-mcp/SKILL.md +113 -4
- 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 +79 -0
- package/dist/debugger/diagnostics.js +54 -0
- package/dist/debugger/guard.js +30 -0
- package/dist/debugger/protocol.js +33 -0
- package/dist/debugger/sessions.js +304 -0
- package/dist/debugger/worker.js +176 -0
- 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 -3074
- 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 +122 -76
- 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 +13 -2
- package/dist/observe/readiness.js +44 -18
- 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-android.js +135 -0
- package/dist/observe/system-trace.js +294 -0
- 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/handlers/debugger-handlers.js +48 -0
- 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/schemas/debugger-schema.js +47 -0
- package/dist/server/{journey-schema.js → schemas/journey-schema.js} +8 -22
- package/dist/server/schemas/system-trace-schema.js +17 -0
- package/dist/server/tool-definitions.js +62 -1134
- package/dist/server-core.js +4 -4
- package/dist/server.js +34 -0
- package/dist/system/android-status.js +101 -0
- package/dist/system/android.js +37 -27
- package/dist/system/index.js +13 -438
- 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/exec.js +2 -0
- package/dist/utils/ios/utils.js +45 -46
- package/dist/utils/java.js +75 -57
- package/dist/utils/operation-budget.js +2 -0
- package/dist/utils/resolve-device.js +6 -2
- package/dist/utils/ui/index.js +26 -26
- package/docs/CHANGELOG.md +48 -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/device-evidence.json +38 -0
- package/docs/specs/023-android-system-traces/emulator-recheck.json +38 -0
- package/docs/specs/023-android-system-traces/intent.md +41 -0
- package/docs/specs/023-android-system-traces/plan.md +115 -0
- package/docs/specs/023-android-system-traces/spec.md +122 -0
- package/docs/specs/024-android-heap-dump-capture/intent.md +41 -0
- package/docs/specs/025-android-runtime-debugger/intent.md +41 -0
- package/docs/specs/025-android-runtime-debugger/plan.md +106 -0
- package/docs/specs/025-android-runtime-debugger/spec.md +183 -0
- 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 -16
- package/docs/tools/{evidence.md → correlated-evidence.md} +14 -3
- package/docs/tools/debugger.md +180 -0
- package/docs/tools/interact.md +42 -20
- package/docs/tools/manage.md +25 -44
- package/docs/tools/observe.md +64 -25
- package/docs/tools/system-traces.md +134 -0
- 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 +66 -0
- package/src/debugger/diagnostics.ts +43 -0
- package/src/debugger/guard.ts +31 -0
- package/src/debugger/java/DebuggerWorker.java +166 -0
- package/src/debugger/protocol.ts +37 -0
- package/src/debugger/sessions.ts +327 -0
- package/src/debugger/worker.ts +135 -0
- 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 -3491
- 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 +130 -71
- 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 +10 -3
- package/src/observe/readiness.ts +49 -22
- 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-android.ts +133 -0
- package/src/observe/system-trace.ts +227 -0
- 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/schemas/debugger-schema.ts +43 -0
- package/src/server/{journey-schema.ts → schemas/journey-schema.ts} +8 -22
- package/src/server/schemas/system-trace-schema.ts +17 -0
- package/src/server/tool-definitions.ts +69 -1140
- package/src/server-core.ts +4 -4
- package/src/server.ts +25 -1
- package/src/system/android-status.ts +124 -0
- package/src/system/android.ts +33 -21
- package/src/system/index.ts +21 -523
- 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/exec.ts +2 -0
- package/src/utils/ios/utils.ts +57 -61
- package/src/utils/java.ts +71 -51
- package/src/utils/operation-budget.ts +2 -0
- package/src/utils/resolve-device.ts +11 -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 +219 -0
- package/test/device/automated/interact/interaction.android.test.ts +56 -0
- package/test/device/automated/observe/system-trace.smoke.ts +104 -0
- 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 +67 -0
- package/test/fixtures/debugger-app/MainActivity.kt +32 -0
- package/test/fixtures/debugger-app/NoLocals.java +7 -0
- package/test/fixtures/debugger-app/README.md +65 -0
- package/test/fixtures/debugger-app/build.ts +39 -0
- package/test/fixtures/latency-journey-app/README.md +2 -0
- package/test/fixtures/readiness-app/README.md +2 -0
- package/test/helpers/perfetto.ts +59 -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 +50 -0
- package/test/unit/debugger/native.test.ts +33 -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 +83 -0
- 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/readiness.test.ts +3 -1
- package/test/unit/observe/screenshot-encoding.test.ts +30 -0
- package/test/unit/observe/snapshot-logs.test.ts +14 -0
- package/test/unit/observe/system-trace-android.test.ts +52 -0
- package/test/unit/observe/system-trace.test.ts +166 -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/system-trace.test.ts +64 -0
- package/test/unit/server/tool_definitions_parity.test.ts +8 -0
- package/dist/server/tool-handlers.js +0 -893
- 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/tool-handlers.ts +0 -923
- /package/dist/{server/condition-schema.js → contracts/condition.js} +0 -0
- /package/dist/server/{readiness-schema.js → schemas/readiness-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,194 @@
|
|
|
1
|
+
export const manageTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'start_app',
|
|
4
|
+
description: `Purpose:
|
|
5
|
+
Launch a mobile app on Android or iOS.
|
|
6
|
+
|
|
7
|
+
Inputs:
|
|
8
|
+
- platform
|
|
9
|
+
- appId
|
|
10
|
+
- deviceId (optional)
|
|
11
|
+
|
|
12
|
+
Output Structure:
|
|
13
|
+
- action_id, timestamp (ISO 8601), action_type
|
|
14
|
+
- lifecycle_state: post-dispatch lifecycle state (pending_verification or failed)
|
|
15
|
+
- source_module: runtime source of the action envelope
|
|
16
|
+
- target.selector = { appId }
|
|
17
|
+
- success = true when launch was dispatched successfully
|
|
18
|
+
- failure_code/retryable when launch dispatch fails
|
|
19
|
+
- ui_fingerprint_before/ui_fingerprint_after when available
|
|
20
|
+
|
|
21
|
+
Recommended Usage:
|
|
22
|
+
1. Define the expected landing screen when it is known
|
|
23
|
+
2. Call start_app
|
|
24
|
+
3. If needed, wait for transition using wait_for_*
|
|
25
|
+
4. Verify with expect_screen
|
|
26
|
+
5. If verification fails, retry once or capture a snapshot
|
|
27
|
+
|
|
28
|
+
Verification Guidance:
|
|
29
|
+
- Follow RESOLVE → ACT → WAIT (if needed) → EXPECT
|
|
30
|
+
- expect_screen is the authoritative verification step when the landing screen is known
|
|
31
|
+
- Do not treat timing or screen change alone as final verification
|
|
32
|
+
|
|
33
|
+
Failure Handling:
|
|
34
|
+
- TIMEOUT → retry once
|
|
35
|
+
- UNKNOWN → inspect snapshot/logs before retrying`,
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
properties: {
|
|
39
|
+
platform: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
enum: ['android', 'ios']
|
|
42
|
+
},
|
|
43
|
+
appId: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Android package name or iOS bundle id'
|
|
46
|
+
},
|
|
47
|
+
deviceId: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Device UDID (iOS) or Serial (Android). Defaults to booted/connected.'
|
|
50
|
+
},
|
|
51
|
+
verificationMode: { type: 'string', enum: ['none', 'light', 'full'], default: 'full' },
|
|
52
|
+
responseMode: { type: 'string', enum: ['compact', 'debug'], default: 'debug' },
|
|
53
|
+
actionTimeoutMs: { type: 'number', minimum: 100, maximum: 30000 },
|
|
54
|
+
verificationTimeoutMs: { type: 'number', minimum: 100, maximum: 60000 }
|
|
55
|
+
},
|
|
56
|
+
required: ['platform', 'appId']
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'terminate_app',
|
|
61
|
+
description: 'Terminate a mobile app on Android or iOS simulator',
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: {
|
|
65
|
+
platform: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
enum: ['android', 'ios']
|
|
68
|
+
},
|
|
69
|
+
appId: {
|
|
70
|
+
type: 'string',
|
|
71
|
+
description: 'Android package name or iOS bundle id'
|
|
72
|
+
},
|
|
73
|
+
deviceId: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
description: 'Device UDID (iOS) or Serial (Android). Defaults to booted/connected.'
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
required: ['platform', 'appId']
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'restart_app',
|
|
83
|
+
description: `Purpose:
|
|
84
|
+
Restart a mobile app on Android or iOS.
|
|
85
|
+
|
|
86
|
+
Inputs:
|
|
87
|
+
- platform
|
|
88
|
+
- appId
|
|
89
|
+
- deviceId (optional)
|
|
90
|
+
|
|
91
|
+
Output Structure:
|
|
92
|
+
- action_id, timestamp (ISO 8601), action_type
|
|
93
|
+
- lifecycle_state: post-dispatch lifecycle state (pending_verification or failed)
|
|
94
|
+
- source_module: runtime source of the action envelope
|
|
95
|
+
- target.selector = { appId }
|
|
96
|
+
- success = true when the restart command completed
|
|
97
|
+
- failure_code/retryable when restart dispatch fails
|
|
98
|
+
- ui_fingerprint_before/ui_fingerprint_after when available
|
|
99
|
+
|
|
100
|
+
Recommended Usage:
|
|
101
|
+
1. Define the expected landing screen when it is known
|
|
102
|
+
2. Call restart_app
|
|
103
|
+
3. If needed, wait for transition using wait_for_*
|
|
104
|
+
4. Verify with expect_screen
|
|
105
|
+
5. If verification fails, retry once or capture a snapshot
|
|
106
|
+
|
|
107
|
+
Verification Guidance:
|
|
108
|
+
- Follow RESOLVE → ACT → WAIT (if needed) → EXPECT
|
|
109
|
+
- expect_screen is the authoritative verification step when the reopened screen is known
|
|
110
|
+
- Do not treat timing or screen change alone as final verification
|
|
111
|
+
|
|
112
|
+
Failure Handling:
|
|
113
|
+
- TIMEOUT → retry once
|
|
114
|
+
- UNKNOWN → inspect snapshot/logs before retrying`,
|
|
115
|
+
inputSchema: {
|
|
116
|
+
type: 'object',
|
|
117
|
+
properties: {
|
|
118
|
+
platform: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
enum: ['android', 'ios']
|
|
121
|
+
},
|
|
122
|
+
appId: {
|
|
123
|
+
type: 'string',
|
|
124
|
+
description: 'Android package name or iOS bundle id'
|
|
125
|
+
},
|
|
126
|
+
deviceId: {
|
|
127
|
+
type: 'string',
|
|
128
|
+
description: 'Device UDID (iOS) or Serial (Android). Defaults to booted/connected.'
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
required: ['platform', 'appId']
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'reset_app_data',
|
|
136
|
+
description: 'Reset app data (clear storage) for a mobile app on Android or iOS simulator',
|
|
137
|
+
inputSchema: {
|
|
138
|
+
type: 'object',
|
|
139
|
+
properties: {
|
|
140
|
+
platform: {
|
|
141
|
+
type: 'string',
|
|
142
|
+
enum: ['android', 'ios']
|
|
143
|
+
},
|
|
144
|
+
appId: {
|
|
145
|
+
type: 'string',
|
|
146
|
+
description: 'Android package name or iOS bundle id'
|
|
147
|
+
},
|
|
148
|
+
deviceId: {
|
|
149
|
+
type: 'string',
|
|
150
|
+
description: 'Device UDID (iOS) or Serial (Android). Defaults to booted/connected.'
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
required: ['platform', 'appId']
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'install_app',
|
|
158
|
+
description: 'Install an app on Android or iOS. Accepts a built binary (apk/.ipa/.app) or a project directory to build then install. platform and projectType are required.',
|
|
159
|
+
inputSchema: {
|
|
160
|
+
type: 'object',
|
|
161
|
+
properties: {
|
|
162
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Platform to install to (required).' },
|
|
163
|
+
projectType: { type: 'string', enum: ['native', 'kmp', 'react-native', 'flutter'], description: 'Project type to guide build/install tool selection (required).' },
|
|
164
|
+
appPath: { type: 'string', description: 'Path to APK, .app, .ipa, or project directory' },
|
|
165
|
+
deviceId: { type: 'string', description: 'Device UDID (iOS) or Serial (Android). Defaults to booted/connected.' }
|
|
166
|
+
},
|
|
167
|
+
required: ['platform', 'projectType', 'appPath']
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'build_app',
|
|
172
|
+
description: 'Build a project for Android or iOS and return the built artifact path. Does not install. platform and projectType are required.',
|
|
173
|
+
inputSchema: {
|
|
174
|
+
type: 'object',
|
|
175
|
+
properties: {
|
|
176
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Platform to build for (required).' },
|
|
177
|
+
projectType: { type: 'string', enum: ['native', 'kmp', 'react-native', 'flutter'], description: 'Project type to guide build tool selection (required).' },
|
|
178
|
+
projectPath: { type: 'string', description: 'Path to project directory (contains gradlew or xcodeproj/xcworkspace)' },
|
|
179
|
+
variant: { type: 'string', description: 'Optional build variant (e.g., Debug/Release)' }
|
|
180
|
+
},
|
|
181
|
+
required: ['platform', 'projectType', 'projectPath']
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'list_devices',
|
|
186
|
+
description: 'List connected devices and their metadata (android + ios).',
|
|
187
|
+
inputSchema: {
|
|
188
|
+
type: 'object',
|
|
189
|
+
properties: {
|
|
190
|
+
platform: { type: 'string', enum: ['android', 'ios'] }
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
];
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
export const observeTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'get_logs',
|
|
4
|
+
description: 'Get recent logs from Android or iOS simulator. Returns device metadata and structured logs suitable for AI consumption.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
platform: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
enum: ['android', 'ios']
|
|
11
|
+
},
|
|
12
|
+
appId: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'Filter by Android package name or iOS bundle id'
|
|
15
|
+
},
|
|
16
|
+
deviceId: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'Device UDID (iOS) or Serial (Android). Defaults to booted/connected.'
|
|
19
|
+
},
|
|
20
|
+
pid: { type: 'number', description: 'Filter by process id' },
|
|
21
|
+
tag: { type: 'string', description: 'Filter by tag (Android) or subsystem/category (iOS)' },
|
|
22
|
+
level: { type: 'string', description: 'Log level filter (VERBOSE, DEBUG, INFO, WARN, ERROR)' },
|
|
23
|
+
contains: { type: 'string', description: 'Substring to match in log message' },
|
|
24
|
+
since_seconds: { type: 'number', description: 'Only return logs from the last N seconds' },
|
|
25
|
+
limit: { type: 'number', description: 'Override default number of returned lines' },
|
|
26
|
+
lines: {
|
|
27
|
+
type: 'number',
|
|
28
|
+
description: 'Legacy - number of log lines (android only)'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
required: ['platform']
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'capture_screenshot',
|
|
36
|
+
description: 'Capture a screenshot from an Android device or iOS simulator. Returns device metadata and the screenshot image.',
|
|
37
|
+
inputSchema: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
platform: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
enum: ['android', 'ios']
|
|
43
|
+
},
|
|
44
|
+
deviceId: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: 'Device UDID (iOS) or Serial (Android). Defaults to booted/connected.'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
required: ['platform']
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'capture_debug_snapshot',
|
|
54
|
+
description: 'Capture a complete debug snapshot (raw observation layer plus optional derived semantic layer). Returns structured JSON with snapshot_revision, captured_at_ms, snapshot_delta, and loading_state when detectable.',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
reason: { type: 'string', description: 'Optional reason for snapshot' },
|
|
59
|
+
includeLogs: { type: 'boolean', description: 'Whether to include logs', default: true },
|
|
60
|
+
includeScreenshot: { type: 'boolean', description: 'Whether to collect screenshot bytes', default: true },
|
|
61
|
+
logLines: { type: 'number', description: 'Maximum number of log lines to include', default: 200 },
|
|
62
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Optional platform override' },
|
|
63
|
+
appId: { type: 'string', description: 'Optional appId to scope logs (package/bundle id)' },
|
|
64
|
+
deviceId: { type: 'string', description: 'Optional device serial/udid' },
|
|
65
|
+
sessionId: { type: 'string', description: 'Optional log stream session id to prefer' }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'start_log_stream',
|
|
71
|
+
description: 'Start streaming logs for a target application on Android or iOS. For Android this uses adb logcat --pid=<pid>; for iOS it streams `xcrun simctl spawn <device> log stream` with a predicate.',
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {
|
|
75
|
+
platform: { type: 'string', enum: ['android', 'ios'], default: 'android' },
|
|
76
|
+
packageName: { type: 'string', description: 'Android package name or iOS bundle id' },
|
|
77
|
+
level: { type: 'string', enum: ['error', 'warn', 'info', 'debug'], default: 'error' },
|
|
78
|
+
deviceId: { type: 'string', description: 'Device Serial (Android) or UDID (iOS). Defaults to connected/booted device.' },
|
|
79
|
+
sessionId: { type: 'string', description: 'Session identifier for the log stream' }
|
|
80
|
+
},
|
|
81
|
+
required: ['packageName']
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'read_log_stream',
|
|
86
|
+
description: 'Read accumulated log stream entries for the active session.',
|
|
87
|
+
inputSchema: {
|
|
88
|
+
type: 'object',
|
|
89
|
+
properties: {
|
|
90
|
+
sessionId: { type: 'string' }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'stop_log_stream',
|
|
96
|
+
description: 'Stop an active log stream for the session.',
|
|
97
|
+
inputSchema: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
properties: {
|
|
100
|
+
sessionId: { type: 'string' }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'get_ui_tree',
|
|
106
|
+
description: 'Get the current UI hierarchy from an Android device or iOS simulator. Returns a structured JSON representation of the screen content with snapshot metadata and incremental delta signals when available.',
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: 'object',
|
|
109
|
+
properties: {
|
|
110
|
+
platform: {
|
|
111
|
+
type: 'string',
|
|
112
|
+
enum: ['android', 'ios'],
|
|
113
|
+
description: 'Platform to get UI tree for'
|
|
114
|
+
},
|
|
115
|
+
deviceId: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
description: 'Device Serial (Android) or UDID (iOS). Defaults to connected/booted device.'
|
|
118
|
+
},
|
|
119
|
+
responseMode: { type: 'string', enum: ['compact', 'debug'], default: 'debug' },
|
|
120
|
+
sinceSnapshotRevision: { type: 'number', minimum: 1 }
|
|
121
|
+
},
|
|
122
|
+
required: ['platform']
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'get_current_screen',
|
|
127
|
+
description: 'Get the currently visible activity on an Android device. Returns package and activity name.',
|
|
128
|
+
inputSchema: {
|
|
129
|
+
type: 'object',
|
|
130
|
+
properties: {
|
|
131
|
+
deviceId: {
|
|
132
|
+
type: 'string',
|
|
133
|
+
description: 'Device Serial (Android). Defaults to connected/booted device.'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'get_screen_fingerprint',
|
|
140
|
+
description: 'Generate a stable fingerprint representing the current visible screen (activity + visible UI elements).',
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: 'object',
|
|
143
|
+
properties: {
|
|
144
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Optional platform override (android|ios)' },
|
|
145
|
+
deviceId: { type: 'string', description: 'Optional device id/udid to target' }
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
];
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
export const targetTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'adjust_control',
|
|
4
|
+
description: `Purpose:
|
|
5
|
+
Adjust a numeric control value with verification.
|
|
6
|
+
|
|
7
|
+
This is the initial adjustable-control surface for slider-like controls and other controls that expose a numeric value or value_range.
|
|
8
|
+
|
|
9
|
+
Inputs:
|
|
10
|
+
- exactly one of selector or element_id
|
|
11
|
+
- property (defaults to "value")
|
|
12
|
+
- targetValue
|
|
13
|
+
- tolerance (optional; discrete default is 0, continuous default is max(step / 2, 1% of range) when omitted)
|
|
14
|
+
- maxAttempts (optional; defaults to 5)
|
|
15
|
+
- platform/deviceId (optional)
|
|
16
|
+
|
|
17
|
+
Output Structure:
|
|
18
|
+
- action_id, timestamp (ISO 8601), action_type
|
|
19
|
+
- lifecycle_state: post-dispatch lifecycle state (pending_verification or failed)
|
|
20
|
+
- source_module: runtime source of the action envelope
|
|
21
|
+
- target_state / actual_state / within_tolerance / converged / attempts / adjustment_mode
|
|
22
|
+
- target.selector = original selector or element handle
|
|
23
|
+
- success = true when the control converges within tolerance
|
|
24
|
+
|
|
25
|
+
Verification Guidance:
|
|
26
|
+
- Prefer direct platform adjustment when the runtime exposes it; then verified increment/decrement actions; use coordinate fallback only as degraded mode
|
|
27
|
+
- Use expect_state for the control value readback
|
|
28
|
+
- Do not use derived semantic metadata as proof of success
|
|
29
|
+
|
|
30
|
+
Failure Handling:
|
|
31
|
+
- ELEMENT_NOT_FOUND → re-resolve the control
|
|
32
|
+
- ELEMENT_NOT_INTERACTABLE → the control cannot be adjusted through the current runtime
|
|
33
|
+
- CONTROL_CONVERGENCE_FAILED → the control did not converge within bounded retries or the requested value is out of range
|
|
34
|
+
- UNKNOWN → capture a snapshot and stop`,
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
selector: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {
|
|
41
|
+
text: { type: 'string' },
|
|
42
|
+
resource_id: { type: 'string' },
|
|
43
|
+
accessibility_id: { type: 'string' },
|
|
44
|
+
contains: { type: 'boolean', default: false }
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
element_id: { type: 'string', description: 'Optional previously resolved element identifier.' },
|
|
48
|
+
property: { type: 'string', description: 'Readable numeric state property to adjust.', default: 'value' },
|
|
49
|
+
targetValue: { type: 'number', description: 'Target numeric value.' },
|
|
50
|
+
tolerance: { type: 'number', description: 'Accepted numeric tolerance around the target value. Defaults are derived from the readable control domain.' },
|
|
51
|
+
maxAttempts: { type: 'number', description: 'Maximum adjustment attempts.', default: 5 },
|
|
52
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Optional platform override' },
|
|
53
|
+
deviceId: { type: 'string', description: 'Optional device serial/udid' }
|
|
54
|
+
},
|
|
55
|
+
required: ['targetValue'],
|
|
56
|
+
oneOf: [
|
|
57
|
+
{ required: ['selector'] },
|
|
58
|
+
{ required: ['element_id'] }
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'find_element',
|
|
64
|
+
description: `Find a UI element by semantic query (text, content-desc, resource-id, class).
|
|
65
|
+
|
|
66
|
+
Returns the best match plus resolution metadata when available, including confidence, selection reason, and fallback alternates.`,
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
query: { type: 'string', description: 'Search query (text or label)' },
|
|
71
|
+
exact: { type: 'boolean', description: 'Require exact match (true/false)', default: false },
|
|
72
|
+
timeoutMs: { type: 'number', description: 'Timeout in ms to keep searching', default: 3000 },
|
|
73
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Optional platform override' },
|
|
74
|
+
deviceId: { type: 'string', description: 'Optional device serial/udid' }
|
|
75
|
+
},
|
|
76
|
+
required: ['query']
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'tap_element',
|
|
81
|
+
description: `Purpose:
|
|
82
|
+
Tap a previously resolved UI element using its elementId.
|
|
83
|
+
|
|
84
|
+
Inputs:
|
|
85
|
+
- elementId: a resolved UI element identifier returned by wait_for_ui
|
|
86
|
+
|
|
87
|
+
Output Structure:
|
|
88
|
+
- action_id: unique timestamp-based action identifier
|
|
89
|
+
- timestamp: ISO 8601 timestamp for the action attempt
|
|
90
|
+
- action_type: "tap_element"
|
|
91
|
+
- lifecycle_state: post-dispatch lifecycle state (pending_verification or failed)
|
|
92
|
+
- source_module: runtime source of the action envelope
|
|
93
|
+
- target.selector: original target handle ({ elementId })
|
|
94
|
+
- target.resolved: minimal resolved element info used for the tap
|
|
95
|
+
- success: true when the tap was dispatched
|
|
96
|
+
- failure_code: present when success=false
|
|
97
|
+
- retryable: present when failure_code exists
|
|
98
|
+
- ui_fingerprint_before/ui_fingerprint_after: optional fingerprints captured around the action
|
|
99
|
+
|
|
100
|
+
Recommended Usage:
|
|
101
|
+
1. Resolve the target with wait_for_ui or another deterministic resolver
|
|
102
|
+
2. Call tap_element
|
|
103
|
+
3. If needed, wait for transition using wait_for_*
|
|
104
|
+
4. Verify outcome using expect_*
|
|
105
|
+
- use expect_screen when navigation is expected
|
|
106
|
+
- use expect_element_visible when the UI change is local
|
|
107
|
+
5. If verification fails, inspect failure_code and follow the retry strategy below
|
|
108
|
+
|
|
109
|
+
Verification Guidance:
|
|
110
|
+
- Follow RESOLVE → ACT → WAIT (if needed) → EXPECT
|
|
111
|
+
- Prefer expect_screen for navigation or modal transitions
|
|
112
|
+
- Prefer expect_element_visible when the tap should reveal or update a specific element
|
|
113
|
+
- wait_for_* may be used for resolution and synchronization, but not as the final verification step when an applicable expect_* tool exists
|
|
114
|
+
- Do not treat tap_element.success as outcome success; it only means the tap was executed
|
|
115
|
+
|
|
116
|
+
Failure Handling:
|
|
117
|
+
- STALE_REFERENCE → re-resolve the element, then retry
|
|
118
|
+
- ELEMENT_NOT_INTERACTABLE → wait or refine the target, then retry
|
|
119
|
+
- UNKNOWN → capture a snapshot and stop
|
|
120
|
+
|
|
121
|
+
This tool reports execution success only. Verification must be done with a separate expect_* tool.`,
|
|
122
|
+
inputSchema: {
|
|
123
|
+
type: 'object',
|
|
124
|
+
properties: {
|
|
125
|
+
elementId: {
|
|
126
|
+
type: 'string',
|
|
127
|
+
description: 'A unique element identifier returned by wait_for_ui'
|
|
128
|
+
},
|
|
129
|
+
selector: { type: 'object', properties: { text: { type: 'string' }, resource_id: { type: 'string' }, accessibility_id: { type: 'string' }, contains: { type: 'boolean' } } },
|
|
130
|
+
waitFor: { type: 'object', properties: { condition: { type: 'string', enum: ['exists', 'visible', 'clickable'] }, timeoutMs: { type: 'number', minimum: 100, maximum: 10000 }, pollIntervalMs: { type: 'number', minimum: 50, maximum: 1000 }, match: { type: 'object', properties: { index: { type: 'number' } } } } },
|
|
131
|
+
platform: { type: 'string', enum: ['android', 'ios'] },
|
|
132
|
+
deviceId: { type: 'string' },
|
|
133
|
+
verificationMode: { type: 'string', enum: ['none', 'light', 'full'], default: 'full' },
|
|
134
|
+
responseMode: { type: 'string', enum: ['compact', 'debug'], default: 'debug' }
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
];
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export const waitTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'wait_for_screen_change',
|
|
4
|
+
description: `Purpose:
|
|
5
|
+
Detect that a screen transition has occurred by waiting for the current fingerprint to differ from a previous fingerprint.
|
|
6
|
+
|
|
7
|
+
Capabilities:
|
|
8
|
+
- Synchronization for uncertain navigation timing
|
|
9
|
+
- Detection that something changed on screen
|
|
10
|
+
|
|
11
|
+
Constraints:
|
|
12
|
+
- Does not verify correctness of the resulting state
|
|
13
|
+
- Must not be used alone to confirm action success when an applicable expect_* tool exists
|
|
14
|
+
- For backend/API activity without a visible UI change, pass the runtime action_type into classify_action_outcome and collect network evidence only if the result remains ambiguous
|
|
15
|
+
|
|
16
|
+
Recommended Usage:
|
|
17
|
+
1. Capture or define the expected outcome
|
|
18
|
+
2. Call an action tool
|
|
19
|
+
3. Use wait_for_screen_change when transition timing is uncertain
|
|
20
|
+
4. Follow with expect_screen when the expected destination is known`,
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {
|
|
24
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Optional platform override (android|ios)' },
|
|
25
|
+
previousFingerprint: { type: 'string', description: 'The fingerprint to compare against (required)' },
|
|
26
|
+
timeoutMs: { type: 'number', description: 'Timeout in ms to wait for change (default 5000)', default: 5000 },
|
|
27
|
+
pollIntervalMs: { type: 'number', description: 'Polling interval in ms (default 300)', default: 300 },
|
|
28
|
+
deviceId: { type: 'string', description: 'Optional device id/udid to target' }
|
|
29
|
+
},
|
|
30
|
+
required: ['previousFingerprint']
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'wait_for_ui_change',
|
|
35
|
+
description: `Purpose:
|
|
36
|
+
Wait for a non-navigation UI mutation or in-place update to become stable.
|
|
37
|
+
|
|
38
|
+
Inputs:
|
|
39
|
+
- expected_change (optional): hierarchy_diff, text_change, or state_change
|
|
40
|
+
- timeout_ms (optional)
|
|
41
|
+
- stability_window_ms (optional)
|
|
42
|
+
- scope (optional): screen or subtree
|
|
43
|
+
- target (optional): element_id when scope=subtree
|
|
44
|
+
|
|
45
|
+
Guidance:
|
|
46
|
+
- Prefer wait_for_screen_change for navigation transitions.
|
|
47
|
+
- Prefer wait_for_ui_change for in-place mutations and non-navigation updates.
|
|
48
|
+
- Use the returned snapshot_revision as the observed synchronization point when available.
|
|
49
|
+
- Scoped waits return scope-aware stability metadata and a lightweight change summary.
|
|
50
|
+
|
|
51
|
+
Failure Handling:
|
|
52
|
+
- TIMEOUT means the UI did not change in a stable way within the allotted time.`,
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Optional platform override (android|ios)' },
|
|
57
|
+
deviceId: { type: 'string', description: 'Optional device id/udid to target' },
|
|
58
|
+
expected_change: { type: 'string', enum: ['hierarchy_diff', 'text_change', 'state_change'], description: 'Optional type of UI change to wait for' },
|
|
59
|
+
scope: { type: 'string', enum: ['screen', 'subtree'], default: 'screen', description: 'Synchronization scope for the wait' },
|
|
60
|
+
target: { type: 'string', description: 'Target element_id when scope is subtree' },
|
|
61
|
+
timeout_ms: { type: 'number', description: 'Timeout in ms to wait for change (default 60000)', default: 60000 },
|
|
62
|
+
stability_window_ms: { type: 'number', description: 'How long the change must remain stable before success (default 300)', default: 300 }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'wait_for_ui',
|
|
68
|
+
description: `Purpose:
|
|
69
|
+
Resolve elements and/or detect that a UI transition or availability condition has occurred.
|
|
70
|
+
|
|
71
|
+
Capabilities:
|
|
72
|
+
- Deterministic element resolution
|
|
73
|
+
- Synchronization when element timing or availability is uncertain
|
|
74
|
+
|
|
75
|
+
Constraints:
|
|
76
|
+
- Does not verify correctness of the resulting state
|
|
77
|
+
- Must not be used alone to confirm action success when an applicable expect_* tool exists
|
|
78
|
+
|
|
79
|
+
Recommended Usage:
|
|
80
|
+
1. Use wait_for_ui to resolve an element before acting or to wait for UI readiness
|
|
81
|
+
2. Call the action tool
|
|
82
|
+
3. If the expected outcome is known, follow with expect_* as final verification`,
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
selector: {
|
|
87
|
+
type: 'object',
|
|
88
|
+
properties: {
|
|
89
|
+
text: { type: 'string' },
|
|
90
|
+
resource_id: { type: 'string' },
|
|
91
|
+
accessibility_id: { type: 'string' },
|
|
92
|
+
contains: { type: 'boolean', description: 'When true, perform substring matching', default: false }
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
condition: { type: 'string', enum: ['exists', 'not_exists', 'visible', 'clickable'], default: 'exists' },
|
|
96
|
+
timeout_ms: { type: 'number', default: 60000 },
|
|
97
|
+
poll_interval_ms: { type: 'number', default: 300 },
|
|
98
|
+
match: { type: 'object', properties: { index: { type: 'number' } } },
|
|
99
|
+
retry: { type: 'object', properties: { max_attempts: { type: 'number', default: 1 }, backoff_ms: { type: 'number', default: 0 } } },
|
|
100
|
+
platform: { type: 'string', enum: ['android', 'ios'], description: 'Optional platform override' },
|
|
101
|
+
deviceId: { type: 'string', description: 'Optional device serial/udid' }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
];
|