mobile-debug-mcp 0.26.2 → 0.26.4

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.
@@ -16,6 +16,7 @@ async function run() {
16
16
  assert(names.includes('capture_screenshot'))
17
17
  assert(names.includes('get_ui_tree'))
18
18
  assert(names.includes('tap_element'))
19
+ assert(names.includes('adjust_control'))
19
20
 
20
21
  const waitForUI = toolDefinitions.find((tool) => tool.name === 'wait_for_ui')
21
22
  assert(waitForUI, 'wait_for_ui should be registered')
@@ -66,6 +67,13 @@ async function run() {
66
67
  assert.match((expectElementVisible as any).description, /selector is the primary input/i)
67
68
  assert.match((expectElementVisible as any).description, /Returns structured binary success\/failure only/i)
68
69
 
70
+ const adjustControl = toolDefinitions.find((tool) => tool.name === 'adjust_control')
71
+ assert(adjustControl, 'adjust_control should be registered')
72
+ assert.deepStrictEqual((adjustControl as any).inputSchema.required, ['targetValue'])
73
+ assert.strictEqual((adjustControl as any).inputSchema.properties.targetValue.type, 'number')
74
+ assert.match((adjustControl as any).description, /numeric control value/i)
75
+ assert.match((adjustControl as any).description, /expect_state/i)
76
+
69
77
  const classifyActionOutcome = toolDefinitions.find((tool) => tool.name === 'classify_action_outcome')
70
78
  assert(classifyActionOutcome, 'classify_action_outcome should be registered')
71
79
  assert.match((classifyActionOutcome as any).description, /action_type/i)
@@ -14,6 +14,7 @@ async function run() {
14
14
  const originalExpectScreenHandler = (ToolsInteract as any).expectScreenHandler
15
15
  const originalExpectElementVisibleHandler = (ToolsInteract as any).expectElementVisibleHandler
16
16
  const originalExpectStateHandler = (ToolsInteract as any).expectStateHandler
17
+ const originalAdjustControlHandler = (ToolsInteract as any).adjustControlHandler
17
18
  const originalStartApp = AndroidManage.prototype.startApp
18
19
  const originalCaptureScreenshotHandler = (ToolsObserve as any).captureScreenshotHandler
19
20
  const originalGetUITreeHandler = (ToolsObserve as any).getUITreeHandler
@@ -191,6 +192,43 @@ async function run() {
191
192
  assert.strictEqual(expectStatePayload.expected_state.property, 'checked')
192
193
  assert.strictEqual(expectStatePayload.observed_state.value, true)
193
194
 
195
+ ;(ToolsInteract as any).adjustControlHandler = async () => ({
196
+ action_id: 'adjust_control_1',
197
+ timestamp: '2026-04-29T08:00:00.000Z',
198
+ action_type: 'adjust_control',
199
+ lifecycle_state: 'pending_verification',
200
+ source_module: 'interact',
201
+ target: {
202
+ selector: { elementId: 'el_duration' },
203
+ resolved: {
204
+ elementId: 'el_duration',
205
+ text: 'Duration',
206
+ resource_id: null,
207
+ accessibility_id: null,
208
+ class: 'android.view.View',
209
+ bounds: [0, 0, 100, 20],
210
+ index: 0
211
+ }
212
+ },
213
+ success: true,
214
+ ui_fingerprint_before: 'fp_before',
215
+ ui_fingerprint_after: 'fp_after',
216
+ target_state: { property: 'value', target_value: 30, tolerance: 0.5 },
217
+ actual_state: { property: 'value', value: 30, raw_value: 30 },
218
+ within_tolerance: true,
219
+ converged: true,
220
+ attempts: 1,
221
+ adjustment_mode: 'semantic'
222
+ })
223
+
224
+ const adjustControlResponse = await handleToolCall('adjust_control', { element_id: 'el_duration', targetValue: 30, tolerance: 0.5, property: 'value' })
225
+ const adjustControlPayload = JSON.parse((adjustControlResponse as any).content[0].text)
226
+ assert.strictEqual(adjustControlPayload.success, true)
227
+ assert.strictEqual(adjustControlPayload.action_type, 'adjust_control')
228
+ assert.strictEqual(adjustControlPayload.target_state.target_value, 30)
229
+ assert.strictEqual(adjustControlPayload.within_tolerance, true)
230
+ assert.strictEqual(adjustControlPayload.converged, true)
231
+
194
232
  ;(ToolsInteract as any).tapHandler = async () => {
195
233
  throw new Error('boom')
196
234
  }
@@ -319,6 +357,7 @@ async function run() {
319
357
  ;(ToolsObserve as any).getUITreeHandler = originalGetUITreeHandler
320
358
  ;(ToolsObserve as any).getScreenFingerprintHandler = originalGetScreenFingerprintHandler
321
359
  ;(ToolsObserve as any).captureDebugSnapshotHandler = originalCaptureDebugSnapshotHandler
360
+ ;(ToolsInteract as any).adjustControlHandler = originalAdjustControlHandler
322
361
  }
323
362
  }
324
363