appium-mcp 1.75.3 → 1.75.5
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/CHANGELOG.md +12 -0
- package/dist/tests/tools/gestures/swipe-scroll.test.d.ts +2 -0
- package/dist/tests/tools/gestures/swipe-scroll.test.d.ts.map +1 -0
- package/dist/tests/tools/gestures/swipe-scroll.test.js +55 -0
- package/dist/tests/tools/gestures/swipe-scroll.test.js.map +1 -0
- package/dist/tools/documentation/uploads/embeddings-Xenova-bge-small-en-v1.5.json +1 -1
- package/dist/tools/gestures/handlers/swipe-scroll.d.ts +23 -0
- package/dist/tools/gestures/handlers/swipe-scroll.d.ts.map +1 -1
- package/dist/tools/gestures/handlers/swipe-scroll.js +54 -1
- package/dist/tools/gestures/handlers/swipe-scroll.js.map +1 -1
- package/package.json +2 -2
- package/server.json +2 -2
- package/src/resources/submodules.zip +0 -0
- package/src/tools/gestures/handlers/swipe-scroll.ts +67 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [1.75.5](https://github.com/appium/appium-mcp/compare/v1.75.4...v1.75.5) (2026-05-23)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **gestures:** clamp direction gestures to window for ai-element targets ([#350](https://github.com/appium/appium-mcp/issues/350)) ([6f8db0b](https://github.com/appium/appium-mcp/commit/6f8db0bfa1462b8e54757d154b951425b8e8fbdd))
|
|
6
|
+
|
|
7
|
+
## [1.75.4](https://github.com/appium/appium-mcp/compare/v1.75.3...v1.75.4) (2026-05-23)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* **deps:** bump appium-adb from 14.6.1 to 15.0.0 ([#356](https://github.com/appium/appium-mcp/issues/356)) ([5685814](https://github.com/appium/appium-mcp/commit/5685814b59deff79d020f4a2ff09e256fa334c7d))
|
|
12
|
+
|
|
1
13
|
## [1.75.3](https://github.com/appium/appium-mcp/compare/v1.75.2...v1.75.3) (2026-05-23)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swipe-scroll.test.d.ts","sourceRoot":"","sources":["../../../../src/tests/tools/gestures/swipe-scroll.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { describe, test, expect, jest } from '@jest/globals';
|
|
2
|
+
jest.unstable_mockModule('../../../session-store', () => ({
|
|
3
|
+
getDriver: jest.fn(),
|
|
4
|
+
getPlatformName: jest.fn(),
|
|
5
|
+
PLATFORM: { ios: 'iOS', android: 'Android' },
|
|
6
|
+
}));
|
|
7
|
+
jest.unstable_mockModule('../../../command', () => ({
|
|
8
|
+
execute: jest.fn(),
|
|
9
|
+
getElementRect: jest.fn(),
|
|
10
|
+
getWindowRect: jest.fn(),
|
|
11
|
+
performActions: jest.fn(),
|
|
12
|
+
}));
|
|
13
|
+
jest.unstable_mockModule('../../../tools/ai/config', () => ({
|
|
14
|
+
isAIEnabled: jest.fn(() => false),
|
|
15
|
+
}));
|
|
16
|
+
const { parseAiElement } = await import('../../../tools/gestures/handlers/ai-element.js');
|
|
17
|
+
const { clampDirectionCoordsToWindow, rectVisibleWithinWindow } = await import('../../../tools/gestures/handlers/swipe-scroll.js');
|
|
18
|
+
const PHONE_WINDOW = { x: 0, y: 0, width: 400, height: 800 };
|
|
19
|
+
describe('rectVisibleWithinWindow', () => {
|
|
20
|
+
test('clips ai-element fallback rect that extends past the left edge', () => {
|
|
21
|
+
const parsed = parseAiElement('ai-element:42,84');
|
|
22
|
+
expect('error' in parsed).toBe(false);
|
|
23
|
+
if ('error' in parsed) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const visible = rectVisibleWithinWindow(parsed.rect, PHONE_WINDOW);
|
|
27
|
+
expect(visible.x).toBeGreaterThanOrEqual(0);
|
|
28
|
+
expect(visible.y).toBeGreaterThanOrEqual(0);
|
|
29
|
+
expect(visible.x + visible.width).toBeLessThanOrEqual(PHONE_WINDOW.width);
|
|
30
|
+
expect(visible.y + visible.height).toBeLessThanOrEqual(PHONE_WINDOW.height);
|
|
31
|
+
expect(visible.width).toBeGreaterThan(0);
|
|
32
|
+
expect(visible.height).toBeGreaterThan(0);
|
|
33
|
+
});
|
|
34
|
+
test('returns a 1x1 rect at clamped centre when fully outside the window', () => {
|
|
35
|
+
const offScreen = { x: 500, y: 900, width: 100, height: 100 };
|
|
36
|
+
const visible = rectVisibleWithinWindow(offScreen, PHONE_WINDOW);
|
|
37
|
+
expect(visible).toEqual({ x: 399, y: 799, width: 1, height: 1 });
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
describe('clampDirectionCoordsToWindow', () => {
|
|
41
|
+
test('clamps swipe endpoints into inclusive window pixel bounds', () => {
|
|
42
|
+
const clamped = clampDirectionCoordsToWindow({ startX: -20, startY: 900, endX: 500, endY: -10 }, PHONE_WINDOW);
|
|
43
|
+
expect(clamped).toEqual({
|
|
44
|
+
startX: 0,
|
|
45
|
+
startY: 799,
|
|
46
|
+
endX: 399,
|
|
47
|
+
endY: 0,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
test('preserves in-bounds directional coords', () => {
|
|
51
|
+
const coords = { startX: 200, startY: 600, endX: 200, endY: 200 };
|
|
52
|
+
expect(clampDirectionCoordsToWindow(coords, PHONE_WINDOW)).toEqual(coords);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=swipe-scroll.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swipe-scroll.test.js","sourceRoot":"","sources":["../../../../src/tests/tools/gestures/swipe-scroll.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE7D,IAAI,CAAC,mBAAmB,CAAC,wBAAwB,E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