@midscene/android 1.7.5 → 1.7.6-beta-20260423130231.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/dist/es/cli.mjs CHANGED
@@ -9,7 +9,7 @@ import { Agent } from "@midscene/core/agent";
9
9
  import { mergeAndNormalizeAppNameMapping, normalizeForComparison, repeat } from "@midscene/shared/utils";
10
10
  import node_assert from "node:assert";
11
11
  import { execFile } from "node:child_process";
12
- import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionPinch, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam, normalizePinchParam } from "@midscene/core/device";
12
+ import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionLongPress, defineActionPinch, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam, normalizePinchParam } from "@midscene/core/device";
13
13
  import { getTmpFile, sleep } from "@midscene/core/utils";
14
14
  import { MIDSCENE_ADB_PATH, MIDSCENE_ADB_REMOTE_HOST, MIDSCENE_ADB_REMOTE_PORT, MIDSCENE_ANDROID_IME_STRATEGY, globalConfigManager } from "@midscene/shared/env";
15
15
  import { createImgBase64ByFormat, isValidImageBuffer } from "@midscene/shared/img";
@@ -775,24 +775,11 @@ class AndroidDevice {
775
775
  await sleep(100);
776
776
  }
777
777
  }),
778
- defineAction({
779
- name: 'LongPress',
780
- description: 'Trigger a long press on the screen at specified element',
781
- paramSchema: z.object({
782
- duration: z.number().optional().describe('The duration of the long press in milliseconds'),
783
- locate: getMidsceneLocationSchema().describe('The element to be long pressed')
784
- }),
785
- sample: {
786
- locate: {
787
- prompt: 'the message bubble'
788
- }
789
- },
790
- call: async (param)=>{
791
- const element = param.locate;
792
- if (!element) throw new Error('LongPress requires an element to be located');
793
- const [x, y] = element.center;
794
- await this.longPress(x, y, param?.duration);
795
- }
778
+ defineActionLongPress(async (param)=>{
779
+ const element = param.locate;
780
+ if (!element) throw new Error('LongPress requires an element to be located');
781
+ const [x, y] = element.center;
782
+ await this.longPress(x, y, param?.duration);
796
783
  }),
797
784
  defineAction({
798
785
  name: 'PullGesture',
@@ -2008,7 +1995,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
2008
1995
  const tools = new AndroidMidsceneTools();
2009
1996
  runToolsCLI(tools, 'midscene-android', {
2010
1997
  stripPrefix: 'android_',
2011
- version: "1.7.5",
1998
+ version: "1.7.6-beta-20260423130231.0",
2012
1999
  extraCommands: createReportCliCommands()
2013
2000
  }).catch((e)=>{
2014
2001
  process.exit(reportCLIError(e));
package/dist/es/index.mjs CHANGED
@@ -5,7 +5,7 @@ import * as __rspack_external_node_path_c5b9b54f from "node:path";
5
5
  import node_assert from "node:assert";
6
6
  import { execFile } from "node:child_process";
7
7
  import { getMidsceneLocationSchema, z } from "@midscene/core";
8
- import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionPinch, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam, normalizePinchParam } from "@midscene/core/device";
8
+ import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionLongPress, defineActionPinch, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam, normalizePinchParam } from "@midscene/core/device";
9
9
  import { getTmpFile, sleep } from "@midscene/core/utils";
10
10
  import { MIDSCENE_ADB_PATH, MIDSCENE_ADB_REMOTE_HOST, MIDSCENE_ADB_REMOTE_PORT, MIDSCENE_ANDROID_IME_STRATEGY, globalConfigManager, overrideAIConfig } from "@midscene/shared/env";
11
11
  import { createImgBase64ByFormat, isValidImageBuffer } from "@midscene/shared/img";
@@ -678,24 +678,11 @@ class AndroidDevice {
678
678
  await sleep(100);
679
679
  }
680
680
  }),
681
- defineAction({
682
- name: 'LongPress',
683
- description: 'Trigger a long press on the screen at specified element',
684
- paramSchema: z.object({
685
- duration: z.number().optional().describe('The duration of the long press in milliseconds'),
686
- locate: getMidsceneLocationSchema().describe('The element to be long pressed')
687
- }),
688
- sample: {
689
- locate: {
690
- prompt: 'the message bubble'
691
- }
692
- },
693
- call: async (param)=>{
694
- const element = param.locate;
695
- if (!element) throw new Error('LongPress requires an element to be located');
696
- const [x, y] = element.center;
697
- await this.longPress(x, y, param?.duration);
698
- }
681
+ defineActionLongPress(async (param)=>{
682
+ const element = param.locate;
683
+ if (!element) throw new Error('LongPress requires an element to be located');
684
+ const [x, y] = element.center;
685
+ await this.longPress(x, y, param?.duration);
699
686
  }),
700
687
  defineAction({
701
688
  name: 'PullGesture',
@@ -8,7 +8,7 @@ import { mergeAndNormalizeAppNameMapping, normalizeForComparison, repeat } from
8
8
  import node_assert from "node:assert";
9
9
  import { execFile } from "node:child_process";
10
10
  import { getMidsceneLocationSchema, z } from "@midscene/core";
11
- import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionPinch, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam, normalizePinchParam } from "@midscene/core/device";
11
+ import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionLongPress, defineActionPinch, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam, normalizePinchParam } from "@midscene/core/device";
12
12
  import { getTmpFile, sleep } from "@midscene/core/utils";
13
13
  import { MIDSCENE_ADB_PATH, MIDSCENE_ADB_REMOTE_HOST, MIDSCENE_ADB_REMOTE_PORT, MIDSCENE_ANDROID_IME_STRATEGY, globalConfigManager } from "@midscene/shared/env";
14
14
  import { createImgBase64ByFormat, isValidImageBuffer } from "@midscene/shared/img";
@@ -775,24 +775,11 @@ class AndroidDevice {
775
775
  await sleep(100);
776
776
  }
777
777
  }),
778
- defineAction({
779
- name: 'LongPress',
780
- description: 'Trigger a long press on the screen at specified element',
781
- paramSchema: z.object({
782
- duration: z.number().optional().describe('The duration of the long press in milliseconds'),
783
- locate: getMidsceneLocationSchema().describe('The element to be long pressed')
784
- }),
785
- sample: {
786
- locate: {
787
- prompt: 'the message bubble'
788
- }
789
- },
790
- call: async (param)=>{
791
- const element = param.locate;
792
- if (!element) throw new Error('LongPress requires an element to be located');
793
- const [x, y] = element.center;
794
- await this.longPress(x, y, param?.duration);
795
- }
778
+ defineActionLongPress(async (param)=>{
779
+ const element = param.locate;
780
+ if (!element) throw new Error('LongPress requires an element to be located');
781
+ const [x, y] = element.center;
782
+ await this.longPress(x, y, param?.duration);
796
783
  }),
797
784
  defineAction({
798
785
  name: 'PullGesture',
@@ -2012,7 +1999,7 @@ class AndroidMCPServer extends BaseMCPServer {
2012
1999
  constructor(toolsManager){
2013
2000
  super({
2014
2001
  name: '@midscene/android-mcp',
2015
- version: "1.7.5",
2002
+ version: "1.7.6-beta-20260423130231.0",
2016
2003
  description: 'Control the Android device using natural language commands'
2017
2004
  }, toolsManager);
2018
2005
  }
package/dist/lib/cli.js CHANGED
@@ -790,24 +790,11 @@ var __webpack_exports__ = {};
790
790
  await (0, core_utils_namespaceObject.sleep)(100);
791
791
  }
792
792
  }),
793
- (0, device_namespaceObject.defineAction)({
794
- name: 'LongPress',
795
- description: 'Trigger a long press on the screen at specified element',
796
- paramSchema: core_namespaceObject.z.object({
797
- duration: core_namespaceObject.z.number().optional().describe('The duration of the long press in milliseconds'),
798
- locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The element to be long pressed')
799
- }),
800
- sample: {
801
- locate: {
802
- prompt: 'the message bubble'
803
- }
804
- },
805
- call: async (param)=>{
806
- const element = param.locate;
807
- if (!element) throw new Error('LongPress requires an element to be located');
808
- const [x, y] = element.center;
809
- await this.longPress(x, y, param?.duration);
810
- }
793
+ (0, device_namespaceObject.defineActionLongPress)(async (param)=>{
794
+ const element = param.locate;
795
+ if (!element) throw new Error('LongPress requires an element to be located');
796
+ const [x, y] = element.center;
797
+ await this.longPress(x, y, param?.duration);
811
798
  }),
812
799
  (0, device_namespaceObject.defineAction)({
813
800
  name: 'PullGesture',
@@ -2023,7 +2010,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2023
2010
  const tools = new AndroidMidsceneTools();
2024
2011
  (0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-android', {
2025
2012
  stripPrefix: 'android_',
2026
- version: "1.7.5",
2013
+ version: "1.7.6-beta-20260423130231.0",
2027
2014
  extraCommands: (0, core_namespaceObject.createReportCliCommands)()
2028
2015
  }).catch((e)=>{
2029
2016
  process.exit((0, cli_namespaceObject.reportCLIError)(e));
package/dist/lib/index.js CHANGED
@@ -712,24 +712,11 @@ var __webpack_exports__ = {};
712
712
  await (0, utils_namespaceObject.sleep)(100);
713
713
  }
714
714
  }),
715
- (0, device_namespaceObject.defineAction)({
716
- name: 'LongPress',
717
- description: 'Trigger a long press on the screen at specified element',
718
- paramSchema: core_namespaceObject.z.object({
719
- duration: core_namespaceObject.z.number().optional().describe('The duration of the long press in milliseconds'),
720
- locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The element to be long pressed')
721
- }),
722
- sample: {
723
- locate: {
724
- prompt: 'the message bubble'
725
- }
726
- },
727
- call: async (param)=>{
728
- const element = param.locate;
729
- if (!element) throw new Error('LongPress requires an element to be located');
730
- const [x, y] = element.center;
731
- await this.longPress(x, y, param?.duration);
732
- }
715
+ (0, device_namespaceObject.defineActionLongPress)(async (param)=>{
716
+ const element = param.locate;
717
+ if (!element) throw new Error('LongPress requires an element to be located');
718
+ const [x, y] = element.center;
719
+ await this.longPress(x, y, param?.duration);
733
720
  }),
734
721
  (0, device_namespaceObject.defineAction)({
735
722
  name: 'PullGesture',
@@ -805,24 +805,11 @@ var __webpack_exports__ = {};
805
805
  await (0, core_utils_namespaceObject.sleep)(100);
806
806
  }
807
807
  }),
808
- (0, device_namespaceObject.defineAction)({
809
- name: 'LongPress',
810
- description: 'Trigger a long press on the screen at specified element',
811
- paramSchema: core_namespaceObject.z.object({
812
- duration: core_namespaceObject.z.number().optional().describe('The duration of the long press in milliseconds'),
813
- locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The element to be long pressed')
814
- }),
815
- sample: {
816
- locate: {
817
- prompt: 'the message bubble'
818
- }
819
- },
820
- call: async (param)=>{
821
- const element = param.locate;
822
- if (!element) throw new Error('LongPress requires an element to be located');
823
- const [x, y] = element.center;
824
- await this.longPress(x, y, param?.duration);
825
- }
808
+ (0, device_namespaceObject.defineActionLongPress)(async (param)=>{
809
+ const element = param.locate;
810
+ if (!element) throw new Error('LongPress requires an element to be located');
811
+ const [x, y] = element.center;
812
+ await this.longPress(x, y, param?.duration);
826
813
  }),
827
814
  (0, device_namespaceObject.defineAction)({
828
815
  name: 'PullGesture',
@@ -2043,7 +2030,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2043
2030
  constructor(toolsManager){
2044
2031
  super({
2045
2032
  name: '@midscene/android-mcp',
2046
- version: "1.7.5",
2033
+ version: "1.7.6-beta-20260423130231.0",
2047
2034
  description: 'Control the Android device using natural language commands'
2048
2035
  }, toolsManager);
2049
2036
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/android",
3
- "version": "1.7.5",
3
+ "version": "1.7.6-beta-20260423130231.0",
4
4
  "description": "Android automation library for Midscene",
5
5
  "keywords": [
6
6
  "Android UI automation",
@@ -41,8 +41,8 @@
41
41
  "@yume-chan/stream-extra": "2.1.0",
42
42
  "appium-adb": "12.12.1",
43
43
  "sharp": "^0.34.3",
44
- "@midscene/core": "1.7.5",
45
- "@midscene/shared": "1.7.5"
44
+ "@midscene/shared": "1.7.6-beta-20260423130231.0",
45
+ "@midscene/core": "1.7.6-beta-20260423130231.0"
46
46
  },
47
47
  "optionalDependencies": {
48
48
  "@ffmpeg-installer/ffmpeg": "^1.1.0"
@@ -56,7 +56,7 @@
56
56
  "undici": "^6.0.0",
57
57
  "vitest": "3.0.5",
58
58
  "zod": "^3.25.1",
59
- "@midscene/playground": "1.7.5"
59
+ "@midscene/playground": "1.7.6-beta-20260423130231.0"
60
60
  },
61
61
  "license": "MIT",
62
62
  "scripts": {