@midscene/core 0.30.1 → 0.30.2-beta-20250930144216.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.
@@ -29,11 +29,23 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
29
29
  * Flag to track if VL model warning has been shown
30
30
  */
31
31
  private hasWarnedNonVLModel;
32
+ /**
33
+ * Screenshot scale factor derived from actual screenshot dimensions
34
+ */
35
+ private screenshotScale?;
36
+ /**
37
+ * Internal promise to deduplicate screenshot scale computation
38
+ */
39
+ private screenshotScalePromise?;
32
40
  get page(): InterfaceType;
33
41
  /**
34
42
  * Ensures VL model warning is shown once when needed
35
43
  */
36
44
  private ensureVLModelWarning;
45
+ /**
46
+ * Lazily compute the ratio between the physical screenshot width and the logical page width
47
+ */
48
+ private getScreenshotScale;
37
49
  constructor(interfaceInstance: InterfaceType, opts?: AgentOpt);
38
50
  getActionSpace(): Promise<DeviceAction[]>;
39
51
  getUIContext(action?: InsightAction): Promise<UIContext>;
@@ -93,7 +105,7 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
93
105
  } & LocatorValidatorOption): Promise<AgentDescribeElementAtPointResult>;
94
106
  verifyLocator(prompt: string, locateOpt: LocateOption | undefined, expectCenter: [number, number], verifyLocateOption?: LocatorValidatorOption): Promise<LocateValidatorResult>;
95
107
  aiLocate(prompt: TUserPrompt, opt?: LocateOption): Promise<Pick<LocateResultElement, "center" | "rect"> & {
96
- scale: number;
108
+ dpr?: number;
97
109
  }>;
98
110
  aiAssert(assertion: TUserPrompt, msg?: string, opt?: AgentAssertOpt & InsightExtractOption): Promise<{
99
111
  pass: boolean;
@@ -399,4 +399,5 @@ export interface AgentOpt {
399
399
  modelConfig?: TModelConfigFn;
400
400
  cache?: Cache;
401
401
  replanningCycleLimit?: number;
402
+ screenshotScale?: number;
402
403
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midscene/core",
3
3
  "description": "Automate browser actions, extract data, and perform assertions using AI. It offers JavaScript SDK, Chrome extension, and support for scripting in YAML. See https://midscenejs.com/ for details.",
4
- "version": "0.30.1",
4
+ "version": "0.30.2-beta-20250930144216.0",
5
5
  "repository": "https://github.com/web-infra-dev/midscene",
6
6
  "homepage": "https://midscenejs.com/",
7
7
  "main": "./dist/lib/index.js",
@@ -87,8 +87,8 @@
87
87
  "zod": "3.24.3",
88
88
  "semver": "7.5.2",
89
89
  "js-yaml": "4.1.0",
90
- "@midscene/recorder": "0.30.1",
91
- "@midscene/shared": "0.30.1"
90
+ "@midscene/recorder": "0.30.2-beta-20250930144216.0",
91
+ "@midscene/shared": "0.30.2-beta-20250930144216.0"
92
92
  },
93
93
  "devDependencies": {
94
94
  "@rslib/core": "^0.11.2",