mobile-debug-mcp 0.34.0 → 0.36.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/.cursor-plugin/marketplace.json +1 -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 +218 -129
- package/agent-plugin/.antigravity-plugin/README.md +48 -0
- package/agent-plugin/.antigravity-plugin/plugin.json +18 -0
- 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 +50 -11
- package/agent-plugin/cursor/.cursor-plugin/plugin.json +23 -0
- package/agent-plugin/cursor/LICENSE +201 -0
- package/agent-plugin/cursor/README.md +9 -0
- package/agent-plugin/cursor/skills/mobile-debug-mcp/SKILL.md +253 -0
- package/agent-plugin/mcp.json +1 -1
- package/agent-plugin/mcp_config.json +13 -0
- package/agent-plugin/plugin.json +1 -1
- package/agent-plugin/skills/mobile-debug-mcp/SKILL.md +62 -17
- 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/guard.js +4 -4
- package/dist/debugger/ios-worker.js +62 -0
- package/dist/debugger/ios.js +57 -0
- package/dist/debugger/protocol.js +33 -0
- package/dist/debugger/sessions.js +133 -74
- package/dist/debugger/worker.js +59 -46
- 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 +77 -3092
- 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 +44 -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-trace/artifact.js +63 -0
- package/dist/observe/ios-trace/capabilities.js +86 -0
- package/dist/observe/ios-trace/native.js +93 -0
- package/dist/observe/ios-trace/notification.js +35 -0
- package/dist/observe/ios-trace/process.js +98 -0
- package/dist/observe/ios-trace/sessions.js +244 -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 +5 -3
- package/dist/observe/readiness.js +33 -14
- 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-error.js +7 -0
- package/dist/observe/system-trace-router.js +81 -0
- package/dist/observe/system-trace.js +26 -21
- 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 +67 -0
- package/dist/server/handlers/debugger-response.js +9 -0
- package/dist/server/handlers/diagnostic.js +77 -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 +170 -0
- package/dist/server/schemas/condition-schema.js +2 -0
- package/dist/server/{debugger-schema.js → schemas/debugger-schema.js} +20 -12
- package/dist/server/{journey-schema.js → schemas/journey-schema.js} +7 -22
- package/dist/server/schemas/system-trace-schema.js +22 -0
- package/dist/server/tool-definitions.js +58 -1135
- package/dist/server-core.js +2 -2
- package/dist/server.js +4 -4
- 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 +48 -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 +67 -1
- package/docs/README.md +38 -0
- package/docs/agent-plugin-installation-verification.md +39 -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 +120 -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/specs/031-ios-system-traces/intent.md +38 -0
- package/docs/specs/031-ios-system-traces/investigation.md +92 -0
- package/docs/specs/031-ios-system-traces/late-run-failure-evidence.json +32 -0
- package/docs/specs/031-ios-system-traces/plan.md +138 -0
- package/docs/specs/031-ios-system-traces/pr102-monitor-evidence.json +22 -0
- package/docs/specs/031-ios-system-traces/simulator-evidence.json +47 -0
- package/docs/specs/031-ios-system-traces/spec.md +135 -0
- package/docs/specs/032-ios-runtime-debugger/evidence.json +176 -0
- package/docs/specs/032-ios-runtime-debugger/intent.md +38 -0
- package/docs/specs/032-ios-runtime-debugger/plan.md +95 -0
- package/docs/specs/032-ios-runtime-debugger/report.md +205 -0
- package/docs/specs/032-ios-runtime-debugger/spec.md +153 -0
- package/docs/tools/TOOLS.md +31 -18
- package/docs/tools/{evidence.md → correlated-evidence.md} +9 -1
- package/docs/tools/debugger.md +120 -4
- 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 +89 -14
- package/docs/tools/system.md +12 -5
- package/package.json +12 -8
- package/scripts/agent-plugin.mjs +55 -5
- 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 +3 -2
- package/src/debugger/diagnostics.ts +43 -0
- package/src/debugger/guard.ts +10 -5
- package/src/debugger/ios-worker.ts +49 -0
- package/src/debugger/ios.ts +45 -0
- package/{worker → src/debugger/java}/DebuggerWorker.java +9 -3
- package/src/debugger/lldb/breakpoints.py +51 -0
- package/src/debugger/lldb/inspection.py +109 -0
- package/src/debugger/lldb/worker.py +203 -0
- package/src/debugger/protocol.ts +37 -0
- package/src/debugger/sessions.ts +326 -155
- package/src/debugger/worker.ts +57 -41
- 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 +89 -3494
- 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 +67 -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-trace/artifact.ts +55 -0
- package/src/observe/ios-trace/capabilities.ts +74 -0
- package/src/observe/ios-trace/native.ts +72 -0
- package/src/observe/ios-trace/notification.ts +30 -0
- package/src/observe/ios-trace/process.ts +82 -0
- package/src/observe/ios-trace/sessions.ts +204 -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 +6 -4
- package/src/observe/readiness.ts +42 -21
- 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-error.ts +3 -0
- package/src/observe/system-trace-router.ts +61 -0
- package/src/observe/system-trace.ts +28 -19
- 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 +58 -0
- package/src/server/handlers/debugger-response.ts +7 -0
- package/src/server/handlers/diagnostic.ts +86 -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 +170 -0
- package/src/server/schemas/condition-schema.ts +2 -0
- package/src/server/schemas/debugger-schema.ts +46 -0
- package/src/server/{journey-schema.ts → schemas/journey-schema.ts} +7 -22
- package/src/server/schemas/system-trace-schema.ts +23 -0
- package/src/server/tool-definitions.ts +67 -1143
- package/src/server-core.ts +2 -2
- package/src/server.ts +4 -4
- 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 +60 -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/debugger/runtime.ios.test.ts +221 -0
- package/test/device/automated/interact/interaction.android.test.ts +56 -0
- package/test/device/automated/observe/ios-system-trace.smoke.ts +119 -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 +3696 -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/ios-debugger-app/Main.swift +95 -0
- package/test/fixtures/ios-debugger-app/README.md +27 -0
- package/test/fixtures/ios-debugger-app/build.ts +21 -0
- package/test/fixtures/latency-journey-app/README.md +2 -0
- package/test/fixtures/readiness-app/README.md +2 -0
- package/test/helpers/ios-trace-shutdown.ts +29 -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/handle-guards.test.ts +88 -0
- package/test/unit/debugger/ios-preparation.test.ts +57 -0
- package/test/unit/debugger/ios.test.ts +104 -0
- package/test/unit/debugger/lldb-worker.py +166 -0
- package/test/unit/debugger/lldb-worker.test.ts +10 -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/ios-trace-native.test.ts +90 -0
- package/test/unit/observe/ios-trace-sessions.test.ts +131 -0
- package/test/unit/observe/readiness.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/observe/system-trace-router.test.ts +49 -0
- package/test/unit/quality/agent-plugin-export.test.ts +38 -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 +12 -3
- package/test/unit/server/tool_definitions_parity.test.ts +8 -0
- package/dist/server/debugger-handlers.js +0 -38
- package/dist/server/system-trace-schema.js +0 -17
- 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/debugger-schema.ts +0 -37
- package/src/server/system-trace-schema.ts +0 -17
- 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/src/{server/condition-schema.ts → contracts/condition.ts} +0 -0
- /package/src/server/{readiness-schema.ts → schemas/readiness-schema.ts} +0 -0
|
@@ -1,67 +1,47 @@
|
|
|
1
1
|
# MCP Builder skill
|
|
2
2
|
|
|
3
3
|
name: mcp-builder
|
|
4
|
-
version: 0.1.
|
|
5
|
-
summary:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- Keep SKILL.md compact (this file). Place heavy references in skills/mcp-builder/references/*.md and instruct agents to load them only when needed.
|
|
49
|
-
|
|
50
|
-
# References (implement as separate files)
|
|
51
|
-
- references/toolchain-details.md — exact paths/heuristics used for JBR, JAVA_HOME, ANDROID_SDK locations.
|
|
52
|
-
- references/build-flags.md — gradle/xcodebuild flags used, timeouts, and retry rationale.
|
|
53
|
-
- references/diagnostics-schema.md — JSON schema for runResult and collected artifacts.
|
|
54
|
-
|
|
55
|
-
# Implementation notes for maintainers
|
|
56
|
-
- Implement a thin adapter in src/skills/mcp-builder/index.ts that maps skill actions to existing functions in src/manage and src/utils.
|
|
57
|
-
- Provide unit tests under test/skills/mcp-builder that mock child_process to validate happy/failure paths.
|
|
58
|
-
- Add env toggles: MCP_PREFERS_JBR, MCP_GRADLE_RETRIES, MCP_XCODEBUILD_RETRIES.
|
|
59
|
-
|
|
60
|
-
# Example agent flow
|
|
61
|
-
1. call detect-toolchain({platform:'android', preferJBR:true})
|
|
62
|
-
2. if ok -> call build-android({projectPath:'/path', variant:'Debug'})
|
|
63
|
-
3. call install-android({appPath:'/path/to.apk', deviceId:'emulator-5554'})
|
|
64
|
-
4. if install fails -> call collect-diagnostics({reason:'install failure', platform:'android'})
|
|
65
|
-
|
|
66
|
-
# License
|
|
67
|
-
Same as repository (Apache-2.0).
|
|
4
|
+
version: 0.1.1
|
|
5
|
+
summary: Build, install and diagnose Android/iOS tooling using this repository’s existing adapters and validation commands.
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Use this skill for native builds, installations, toolchain diagnosis and verification
|
|
10
|
+
of `mobile-debug-mcp`. Follow the [shared development process](../../../docs/specs/process.md)
|
|
11
|
+
for scope, approvals and reporting.
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. Inspect the relevant adapter under `src/manage/` and platform helpers under
|
|
16
|
+
`src/utils/`. Reuse their subprocess, timeout and diagnostic handling.
|
|
17
|
+
2. Check only the tools needed by the task. Use the
|
|
18
|
+
[toolchain reference](references/toolchain-details.md) for Java/JBR, adb, idb
|
|
19
|
+
and Xcode discovery; confirm environment settings in the owning source.
|
|
20
|
+
3. For Gradle builds, reuse `prepareGradle()` from `src/utils/android/utils.ts`.
|
|
21
|
+
For iOS builds, follow `src/manage/ios.ts`. Consult
|
|
22
|
+
[build configuration](references/build-flags.md) for supported overrides.
|
|
23
|
+
4. Preserve installation fallbacks and error contracts. Collect command, output,
|
|
24
|
+
exit status and relevant environment details on failure; redact secrets.
|
|
25
|
+
The [diagnostic report format](references/diagnostics-schema.md) is guidance
|
|
26
|
+
for investigations, not a replacement for a tool’s public response shape.
|
|
27
|
+
5. Run `npm run verify` for code changes. Lint includes the
|
|
28
|
+
[structural and architecture gates](../../../docs/code-structure.md); use
|
|
29
|
+
`npm run check:quality` and `npm run check:architecture` to diagnose failures.
|
|
30
|
+
6. For native/runtime changes, run applicable device checks and report the actual
|
|
31
|
+
device, server build, observed result and cleanup. A skipped device suite or
|
|
32
|
+
successful build does not prove device behaviour. The
|
|
33
|
+
[isolated Android fixture](../../../test/fixtures/debugger-app/README.md) covers
|
|
34
|
+
interactions, labelled-control convergence and debugger journeys.
|
|
35
|
+
|
|
36
|
+
## Test placement
|
|
37
|
+
|
|
38
|
+
Follow the [test-authoring skill](../test-authoring/SKILL.md) when changing tests.
|
|
39
|
+
Fake-toolchain tests belong under `test/unit/manage/`, `test/unit/system/` or
|
|
40
|
+
`test/unit/utils/` according to the owning module. Automated native checks belong
|
|
41
|
+
under `test/device/automated/`; ad hoc helpers belong under `test/device/manual/`.
|
|
42
|
+
|
|
43
|
+
## References
|
|
44
|
+
|
|
45
|
+
- [Toolchain details](references/toolchain-details.md): discovery and Java selection.
|
|
46
|
+
- [Build configuration](references/build-flags.md): existing build flags and overrides.
|
|
47
|
+
- [Diagnostics](references/diagnostics-schema.md): reporting command failures.
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
# Build
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
iOS
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
# Build configuration
|
|
2
|
+
|
|
3
|
+
Use the existing platform adapters rather than constructing a second build path.
|
|
4
|
+
The owning implementation is the source of truth for accepted overrides.
|
|
5
|
+
|
|
6
|
+
## Android
|
|
7
|
+
|
|
8
|
+
[prepareGradle()](../../../../src/utils/android/utils.ts) selects the project
|
|
9
|
+
wrapper when present and prepares Java and platform-tools in the child environment.
|
|
10
|
+
[AndroidManage](../../../../src/manage/android.ts) executes that command.
|
|
11
|
+
|
|
12
|
+
| Setting | Current use |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| `MCP_GRADLE_TASK` | Gradle task; defaults to `assembleDebug` |
|
|
15
|
+
| `MCP_GRADLE_WORKERS`, then `MCP_BUILD_JOBS` | Supplies `--max-workers` |
|
|
16
|
+
| `MCP_GRADLE_CACHE=0` | Disables Gradle caching |
|
|
17
|
+
| `ANDROID_STUDIO_JDK`, `ANDROID_STUDIO_JBR`, `JAVA_HOME` | Java selection; see [toolchain details](toolchain-details.md) |
|
|
18
|
+
|
|
19
|
+
The current Android build adapter does not implement `MCP_GRADLE_RETRIES` or
|
|
20
|
+
`MCP_GRADLE_TIMEOUT_MS`. Do not assume iOS watchdog controls apply to Gradle.
|
|
21
|
+
|
|
22
|
+
## iOS
|
|
23
|
+
|
|
24
|
+
[iOSManage](../../../../src/manage/ios.ts) discovers the workspace/project and
|
|
25
|
+
scheme, then supplies simulator destination, derived-data and result-bundle paths.
|
|
26
|
+
|
|
27
|
+
| Setting | Current use |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `XCODEBUILD_PATH` | Build executable; defaults to `xcodebuild` |
|
|
30
|
+
| `MCP_XCODE_DESTINATION_UDID`, then `MCP_XCODE_DESTINATION` | Simulator destination when not supplied in options |
|
|
31
|
+
| `MCP_DERIVED_DATA` | Derived-data path when not supplied in options |
|
|
32
|
+
| `MCP_XCODE_RESULTBUNDLE_PATH` | Result bundle; otherwise generated uniquely per run |
|
|
33
|
+
| `MCP_XCODE_JOBS` | Build parallelism; defaults to 4 unless supplied in options |
|
|
34
|
+
| `MCP_FORCE_CLEAN=1` | Requests clean unless explicitly supplied in options |
|
|
35
|
+
| `MCP_XCODEBUILD_TIMEOUT` | Watchdog duration in milliseconds; defaults to 180000 |
|
|
36
|
+
| `MCP_XCODEBUILD_RETRIES` | Watchdog retries; current parsing falls back to 1 |
|
|
37
|
+
|
|
38
|
+
## Installation and diagnostics
|
|
39
|
+
|
|
40
|
+
Preserve adapter-specific install fallbacks and errors. Use the
|
|
41
|
+
[management reference](../../../../docs/tools/manage.md) for public tool contracts.
|
|
42
|
+
Record exact commands, output, exit status and artifact paths when investigating
|
|
43
|
+
failures; see [diagnostics](diagnostics-schema.md). Keep environment snapshots
|
|
44
|
+
limited to relevant variables and redact secrets.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Diagnostics schema
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this suggested format when reporting a build or toolchain investigation.
|
|
4
|
+
It is not a public MCP response schema or a claim that every adapter returns
|
|
5
|
+
these fields. Preserve the actual tool response and label supplemental diagnostics
|
|
6
|
+
separately; see the [management contracts](../../../../docs/tools/manage.md).
|
|
4
7
|
|
|
5
8
|
Top-level diagnostic object
|
|
6
9
|
{
|
|
@@ -1,62 +1,49 @@
|
|
|
1
|
-
# Toolchain
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- For long-running server processes, prepend java/bin and platform-tools to spawn env PATH when running child builds so external PATH/JAVA_HOME changes don't require a server restart.
|
|
51
|
-
|
|
52
|
-
Examples
|
|
53
|
-
- Detected result (JSON):
|
|
54
|
-
{
|
|
55
|
-
"name": "adb",
|
|
56
|
-
"cmd": "/Users/xxx/Library/Android/sdk/platform-tools/adb",
|
|
57
|
-
"ok": true,
|
|
58
|
-
"version": "Android Debug Bridge version 1.0.41"
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
- Java suggestion when incompatible:
|
|
62
|
-
{ "name": "java", "ok": false, "suggestion": "Found GraalVM (Java 23). Use Java 17 or 21: set ANDROID_STUDIO_JBR or JAVA_HOME." }
|
|
1
|
+
# Toolchain discovery
|
|
2
|
+
|
|
3
|
+
Inspect the owning helper before changing discovery or adding an override. Build
|
|
4
|
+
adapters use these helpers; a separate probe should report the selected executable
|
|
5
|
+
and its actual output, rather than infer success from an environment variable.
|
|
6
|
+
|
|
7
|
+
## Android Java
|
|
8
|
+
|
|
9
|
+
[detectJavaHome()](../../../../src/utils/java.ts) checks explicit
|
|
10
|
+
`ANDROID_STUDIO_JDK`, then `ANDROID_STUDIO_JBR`, known Android Studio JBR locations,
|
|
11
|
+
and `JAVA_HOME`, followed by macOS and Linux fallback locations. The version
|
|
12
|
+
checks accept Java 17 or 21 for Android builds. Exact fallback locations live in
|
|
13
|
+
the helper rather than being duplicated here.
|
|
14
|
+
|
|
15
|
+
Use `java -version` on the selected executable. Distinguish Gradle’s selected JDK
|
|
16
|
+
from the shell Java version and the optional debugger worker’s Java requirements;
|
|
17
|
+
see [the debugger reference](../../../../docs/tools/debugger.md).
|
|
18
|
+
|
|
19
|
+
## adb
|
|
20
|
+
|
|
21
|
+
[resolveAdbCmd()](../../../../src/utils/android/utils.ts) checks, in order:
|
|
22
|
+
|
|
23
|
+
1. An explicit nonempty `ADB_PATH`.
|
|
24
|
+
2. `adb` on `PATH`.
|
|
25
|
+
3. `ANDROID_SDK_ROOT` or `ANDROID_HOME` with `platform-tools/adb`.
|
|
26
|
+
4. The macOS user SDK location.
|
|
27
|
+
5. A final `adb` fallback, whose availability still needs checking.
|
|
28
|
+
|
|
29
|
+
Probe with `adb version` and `adb devices -l`. Use an explicit serial for device
|
|
30
|
+
journeys and record whether it is a physical device or an emulator.
|
|
31
|
+
|
|
32
|
+
## iOS
|
|
33
|
+
|
|
34
|
+
The [iOS command helpers](../../../../src/utils/ios/utils.ts) resolve idb through
|
|
35
|
+
configured overrides and the current installation. `MCP_IDB_PATH` takes precedence
|
|
36
|
+
over `IDB_PATH`; inspect `getConfiguredIdbPath()` for configuration-file fallbacks.
|
|
37
|
+
`getXcrunCmd()` uses `XCRUN_PATH` or `xcrun`.
|
|
38
|
+
|
|
39
|
+
Probe the selected binaries with `idb --version`, `idb list-targets --json`,
|
|
40
|
+
`xcrun --version`, or `xcrun simctl list devices booted` as appropriate. A working
|
|
41
|
+
simulator probe does not establish physical-iOS-device support.
|
|
42
|
+
|
|
43
|
+
## Reporting
|
|
44
|
+
|
|
45
|
+
Record executable paths, relevant versions, device identities and the commands
|
|
46
|
+
that actually ran. Capture only relevant environment variables and redact secrets.
|
|
47
|
+
Use the [diagnostic report guidance](diagnostics-schema.md), keeping supplemental
|
|
48
|
+
diagnostics separate from public MCP responses. For available build settings,
|
|
49
|
+
continue with [build configuration](build-flags.md).
|
|
@@ -11,3 +11,10 @@ Ask these questions while reviewing a spec for implementation and execution read
|
|
|
11
11
|
7. Does it match existing code paths and public tool surfaces?
|
|
12
12
|
8. Can each open concern be classified as a spec issue, execution gap, or implementation issue?
|
|
13
13
|
9. Is the spec ready to execute and implement without further interpretation?
|
|
14
|
+
|
|
15
|
+
For structural refactors, also compare the proposed ownership and dependency
|
|
16
|
+
directions against [the architecture rules](../../../../docs/code-structure.md).
|
|
17
|
+
Check that new contracts are shared across schemas, validation and types, that
|
|
18
|
+
timing-sensitive services have suitable clock/delay seams, and that compatibility
|
|
19
|
+
checks protect public definitions and error behaviour. Passing size limits alone
|
|
20
|
+
does not establish cohesive responsibilities.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Test Authoring skill
|
|
2
2
|
|
|
3
3
|
name: test-authoring
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
summary: Reusable guidance for adding or updating tests in this repository without tying the workflow to a single agent product.
|
|
6
6
|
|
|
7
7
|
# Purpose
|
|
@@ -27,10 +27,11 @@ Activate when an agent needs to:
|
|
|
27
27
|
2. Follow the repository's current automated test style: self-running `tsx` scripts with explicit assertions and non-zero exit on failure.
|
|
28
28
|
3. Put automated unit tests under `test/unit/...`; the unit runner automatically executes every `*.test.ts` file there.
|
|
29
29
|
4. Put automated device smoke tests under `test/device/automated/...`; put human-invoked helpers under `test/device/manual/...`.
|
|
30
|
-
5.
|
|
30
|
+
5. Prefer the extracted services’ typed dependencies and injectable [clocks](../../../src/runtime/clock.ts) over replacing static methods or process-global timers. Reuse existing test seams before adding hooks.
|
|
31
31
|
6. When testing user-facing tools, protect **response shape**, required fields, and documented defaults.
|
|
32
32
|
7. Keep tests deterministic: isolate process-global mocks, prefer fake binaries or injected helpers over shared mutable module state.
|
|
33
|
-
8.
|
|
33
|
+
8. Run `npm run verify` for code/test changes and applicable native checks under the [shared process](../../../docs/specs/process.md#5-verify-and-report).
|
|
34
|
+
9. Follow the [structure and architecture rules](../../../docs/code-structure.md). Keep guardrail failure cases under `test/unit/quality/` and preserve the complete public tool-definition compatibility fixture.
|
|
34
35
|
|
|
35
36
|
# Inputs & outputs
|
|
36
37
|
- choose-test-type(input: { changedPaths[], behaviorType, requiresRealDevice?: boolean }) -> { recommendedType: 'unit'|'device-automated'|'device-manual', rationale, targetPath }
|
|
@@ -49,9 +50,9 @@ Activate when an agent needs to:
|
|
|
49
50
|
- Load detailed references only when deciding placement, matching existing style, or validating new tests.
|
|
50
51
|
|
|
51
52
|
# References
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
53
|
+
- [references/repo-test-layout.md](references/repo-test-layout.md) — where tests belong and what each tree means
|
|
54
|
+
- [references/test-authoring-workflow.md](references/test-authoring-workflow.md) — step-by-step workflow for creating or changing tests
|
|
55
|
+
- [references/test-quality-checklist.md](references/test-quality-checklist.md) — what a good test in this repo should prove before it is considered done
|
|
55
56
|
|
|
56
57
|
# License
|
|
57
58
|
Same as repository (Apache-2.0).
|
|
@@ -15,11 +15,13 @@ Best for:
|
|
|
15
15
|
- response-shape validation
|
|
16
16
|
- shared utility behavior
|
|
17
17
|
- deterministic edge cases
|
|
18
|
+
- injected-clock polling and stabilization checks (`test/unit/interact/`)
|
|
19
|
+
- structural and architectural negative controls (`test/unit/quality/`)
|
|
18
20
|
|
|
19
21
|
## Automated device smoke tests
|
|
20
22
|
|
|
21
23
|
- Location: `test/device/automated/...`
|
|
22
|
-
- Naming:
|
|
24
|
+
- Naming: `*.smoke.ts`, `*.integration.ts`, or `*.test.ts` as supported by the device runner
|
|
23
25
|
- Execution: `npm run test:device`
|
|
24
26
|
- Runner behavior: `test/device/index.ts` runs only the automated subtree
|
|
25
27
|
|
|
@@ -18,7 +18,8 @@ This usually determines the cheapest useful test type.
|
|
|
18
18
|
Before writing a new test, inspect tests already covering the same area:
|
|
19
19
|
|
|
20
20
|
- `test/unit/server/...` for tool registration and response-shape tests
|
|
21
|
-
- `test/unit/interact/...` for handler
|
|
21
|
+
- `test/unit/interact/...` for service, handler and injected-clock tests
|
|
22
|
+
- `test/unit/quality/...` for structural and architecture rule failure cases
|
|
22
23
|
- `test/unit/manage/...` for build/install flows and fake toolchain binaries
|
|
23
24
|
- `test/unit/observe/...` for observe response contracts
|
|
24
25
|
- `test/unit/utils/...` for shared helper coverage
|
|
@@ -44,6 +45,8 @@ For unit tests that need isolation:
|
|
|
44
45
|
|
|
45
46
|
Before adding a new hook, search for:
|
|
46
47
|
|
|
48
|
+
- typed service dependencies under `src/interact/`
|
|
49
|
+
- `Clock` in `src/runtime/clock.ts` for deadlines, stability and retry/backoff tests
|
|
47
50
|
- existing test-only setters/resetters
|
|
48
51
|
- environment-variable based indirection
|
|
49
52
|
- fake executable patterns already used in system/manage tests
|
|
@@ -61,12 +64,18 @@ When testing tools or handlers, cover:
|
|
|
61
64
|
|
|
62
65
|
## 6. Validate with repo commands
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
Run focused tests while iterating, then `npm run verify`. It includes ESLint,
|
|
68
|
+
structural/type checks, ArchUnitTS rules, the build, unit tests and plugin checks.
|
|
69
|
+
Use `npm run check:quality` or `npm run check:architecture` to isolate gate failures;
|
|
70
|
+
see [code structure and quality checks](../../../../docs/code-structure.md).
|
|
71
|
+
|
|
72
|
+
Run `npm run test:device` when native/runtime behaviour changes. Record each
|
|
73
|
+
platform and journey that ran, and label skipped or unavailable coverage as unrun.
|
|
74
|
+
`SKIP_DEVICE_TESTS=1` is honoured only by individual wrappers, not by the device
|
|
75
|
+
runner as a whole. It neither disables every native test nor establishes device
|
|
76
|
+
coverage; report any skipped checks explicitly.
|
|
77
|
+
For isolated Android interaction coverage, see the
|
|
78
|
+
[fixture instructions](../../../../test/fixtures/debugger-app/README.md).
|
|
70
79
|
|
|
71
80
|
## 7. Update docs only when structure or expectations changed
|
|
72
81
|
|
|
@@ -11,7 +11,7 @@ A new test in this repo is high quality when it does most of the following:
|
|
|
11
11
|
|
|
12
12
|
## Determinism
|
|
13
13
|
|
|
14
|
-
-
|
|
14
|
+
- uses injected clocks for timing-dependent services so deadlines and stability can be asserted without real sleeps
|
|
15
15
|
- restores mocks, env vars, and monkeypatches in `finally`
|
|
16
16
|
- avoids leaking state into later tests
|
|
17
17
|
- runs reliably in an isolated subprocess
|
|
@@ -27,6 +27,7 @@ A new test in this repo is high quality when it does most of the following:
|
|
|
27
27
|
- reuses existing helpers, fake-binary patterns, or test seams
|
|
28
28
|
- keeps fixtures as small as possible
|
|
29
29
|
- makes the failure obvious from the assertion message or output
|
|
30
|
+
- uses deliberately broken fixtures for architecture rules, including relevant import forms; an empty or unresolved graph must not count as a pass
|
|
30
31
|
- stays focused on one behavior cluster instead of becoming a broad scenario script
|
|
31
32
|
|
|
32
33
|
## Completion bar
|
|
@@ -1,40 +1,18 @@
|
|
|
1
|
-
# Copilot
|
|
1
|
+
# Copilot instructions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Read [AGENTS.md](../AGENTS.md) and follow the shared [development
|
|
4
|
+
process](../docs/specs/process.md) before planning, editing, or reviewing changes.
|
|
5
|
+
These instructions also apply to delegated work.
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Use the [contribution guide](../CONTRIBUTING.md) for setup, source layout,
|
|
8
|
+
validation commands, and documentation conventions. The [documentation
|
|
9
|
+
index](../docs/README.md) links to current tool contracts and historical designs.
|
|
10
|
+
Load the applicable [repository skill](../.agents/skills/README.md) before test
|
|
11
|
+
authoring, native tooling work, or specification review.
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- **Start**: `npm start` (runs the compiled server at `dist/server.js`)
|
|
13
|
-
- **Dev Workflow**: modify `src/*.ts` -> `npm run build` -> `npm start` to test changes.
|
|
13
|
+
Follow the [module ownership and quality rules](../docs/code-structure.md) when
|
|
14
|
+
changing dependencies or extracting services.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- `src/android.ts`: Encapsulates `adb` commands for Android device interaction.
|
|
19
|
-
- `src/ios.ts`: Encapsulates `xcrun simctl` commands for iOS simulator interaction.
|
|
20
|
-
- **Types**: `src/types.ts` defines shared interfaces for device info and tool responses.
|
|
21
|
-
|
|
22
|
-
## Key Conventions
|
|
23
|
-
|
|
24
|
-
### Tool Implementation
|
|
25
|
-
- **Response Format**: Tools typically return a list of content blocks.
|
|
26
|
-
- `start_app`: Returns a single text block containing JSON (via `wrapResponse`).
|
|
27
|
-
- `terminate_app`: Returns a single text block containing JSON (via `wrapResponse`).
|
|
28
|
-
- `restart_app`: Returns a single text block containing JSON (via `wrapResponse`).
|
|
29
|
-
- `reset_app_data`: Returns a single text block containing JSON (via `wrapResponse`).
|
|
30
|
-
- `get_logs`: Returns a text block (JSON metadata) AND a text block (raw logs).
|
|
31
|
-
- `capture_screenshot`: Returns a text block (JSON metadata) AND an image block (base64 PNG).
|
|
32
|
-
- **Metadata**: Always include a `device` object (platform, id, model, etc.) in the JSON response part.
|
|
33
|
-
|
|
34
|
-
### External Tools
|
|
35
|
-
- **Android**: Uses `process.env.ADB_PATH` or defaults to `adb`.
|
|
36
|
-
- **iOS**: Uses `process.env.XCRUN_PATH` or defaults to `xcrun`. Assumes a booted simulator.
|
|
37
|
-
- **Execution**: Uses `child_process.exec` for running shell commands.
|
|
38
|
-
|
|
39
|
-
### Error Handling
|
|
40
|
-
- Tools should catch execution errors and return a user-friendly error message in a `text` content block, rather than crashing the server.
|
|
16
|
+
Follow existing platform adapters, subprocess helpers, error handling, and MCP
|
|
17
|
+
response conventions. Inspect the relevant implementation and tests rather than
|
|
18
|
+
assuming all tools share one response shape or execution strategy.
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
- name: Use Node.js
|
|
15
15
|
uses: actions/setup-node@v4
|
|
16
16
|
with:
|
|
17
|
-
node-version: '
|
|
17
|
+
node-version: '22'
|
|
18
18
|
- name: Install dependencies
|
|
19
19
|
run: npm ci
|
|
20
20
|
- name: Lint
|
|
@@ -27,14 +27,14 @@ jobs:
|
|
|
27
27
|
distribution: 'temurin'
|
|
28
28
|
java-version: '17'
|
|
29
29
|
- name: Compile optional debugger worker
|
|
30
|
-
run: javac --release 17 --add-modules jdk.jdi -d "$RUNNER_TEMP/mobile-debug-jdi"
|
|
30
|
+
run: javac --release 17 --add-modules jdk.jdi -d "$RUNNER_TEMP/mobile-debug-jdi" src/debugger/java/DebuggerWorker.java
|
|
31
31
|
- name: Check debugger package contents
|
|
32
32
|
run: |
|
|
33
33
|
npm pack --dry-run --json > "$RUNNER_TEMP/mobile-debug-package.json"
|
|
34
34
|
node --input-type=module - "$RUNNER_TEMP/mobile-debug-package.json" <<'JS'
|
|
35
35
|
import fs from 'node:fs'
|
|
36
36
|
const files = new Set(JSON.parse(fs.readFileSync(process.argv[2], 'utf8'))[0].files.map(file => file.path))
|
|
37
|
-
for (const file of ['
|
|
37
|
+
for (const file of ['src/debugger/java/DebuggerWorker.java', 'src/debugger/lldb/worker.py', 'src/debugger/lldb/inspection.py', 'src/debugger/lldb/breakpoints.py', 'dist/debugger/ios.js', 'dist/debugger/ios-worker.js', 'dist/debugger/worker.js', 'dist/debugger/protocol.js', 'dist/runtime/action-results.js', 'dist/server/definitions/input.js', 'dist/server/schemas/debugger-schema.js', 'dist/server/handlers/tool-handlers.js', 'dist/interact/adjustment/adjustment.js', 'dist/interact/targeting/find-element.js', 'dist/interact/waits/ui-wait.js', 'dist/interact/assertions/state-assertion.js', 'dist/observe/network/index.js', 'dist/runtime/clock.js', 'dist/contracts/target.js', 'dist/contracts/execution-controls.js', 'dist/server/handlers/manage.js', 'dist/server/handlers/input.js', 'dist/server/handlers/journey.js']) {
|
|
38
38
|
if (!files.has(file)) throw new Error(`Missing debugger package file: ${file}`)
|
|
39
39
|
}
|
|
40
40
|
JS
|
|
@@ -59,7 +59,7 @@ jobs:
|
|
|
59
59
|
- name: Set up Node.js
|
|
60
60
|
uses: actions/setup-node@v4
|
|
61
61
|
with:
|
|
62
|
-
node-version: '
|
|
62
|
+
node-version: '22'
|
|
63
63
|
|
|
64
64
|
- name: Install dependencies
|
|
65
65
|
run: npm ci
|
package/AGENTS.md
CHANGED
|
@@ -21,12 +21,18 @@ instructions take precedence.
|
|
|
21
21
|
Primary areas:
|
|
22
22
|
|
|
23
23
|
- `src/server.ts` — runtime entrypoint
|
|
24
|
-
- `src/server-core.ts` —
|
|
24
|
+
- `src/server-core.ts` and `src/server/` — MCP registration, capability handlers, schemas and definitions
|
|
25
25
|
- `src/interact/` — tap, swipe, typing, waits, and interaction helpers
|
|
26
26
|
- `src/observe/` — logs, screenshots, UI tree, fingerprints, snapshots
|
|
27
27
|
- `src/manage/` — build, install, start, terminate, restart, reset-app-data
|
|
28
28
|
- `src/system/` — environment and toolchain health checks
|
|
29
|
+
- `src/debugger/` — debugger sessions, protocol and Java worker
|
|
29
30
|
- `src/utils/` — shared helpers and platform-specific utility code
|
|
31
|
+
- `src/contracts/` — shared input shapes and validation
|
|
32
|
+
- `src/runtime/` — action results, traces and injectable clocks
|
|
33
|
+
|
|
34
|
+
See [code structure and quality checks](docs/code-structure.md) for interaction
|
|
35
|
+
subfolders, module ownership, dependency rules and enforced limits.
|
|
30
36
|
|
|
31
37
|
## First things an agent should know
|
|
32
38
|
|
|
@@ -61,7 +67,9 @@ If the task is about **reviewing an RFC or spec draft**, load `.agents/skills/sp
|
|
|
61
67
|
|
|
62
68
|
### Repository docs
|
|
63
69
|
|
|
64
|
-
-
|
|
70
|
+
- [README.md](README.md) — project overview and setup
|
|
71
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md) — development, validation, and documentation conventions
|
|
72
|
+
- [Documentation index](docs/README.md) — user guides, designs, and benchmarks
|
|
65
73
|
- `docs/specs/process.md` — required development workflow for all agents
|
|
66
74
|
- `docs/tools/TOOLS.md` — tool documentation and contracts
|
|
67
75
|
- `docs/CHANGELOG.md` — recent behavioral changes
|
|
@@ -91,7 +99,8 @@ This file is intentionally short. Keep task-specific guidance in `.agents/skills
|
|
|
91
99
|
|
|
92
100
|
- `npm run test:unit` runs every automated unit test under `test/unit/...`
|
|
93
101
|
- `npm run test:device` runs the automated device smoke checks under `test/device/automated/...`
|
|
94
|
-
- `npm run
|
|
102
|
+
- `npm run lint` runs ESLint, structural/type limits and ArchUnitTS dependency checks
|
|
103
|
+
- `npm run verify` runs lint, build, unit tests, and agent-plugin consistency checks
|
|
95
104
|
- Manual and debug-oriented device scripts live under `test/device/manual/...` and are not part of the default test commands
|
|
96
105
|
|
|
97
106
|
## Utility Scripts
|