@midscene/core 1.0.1-beta-20251202152706.0 → 1.0.1-beta-20251203073716.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.
@@ -1,11 +1,12 @@
1
1
  import type { PlanningAIResponse, Size, UIContext } from '../types';
2
2
  import { type IModelConfig, UITarsModelVersion } from '@midscene/shared/env';
3
3
  import type { ConversationHistory } from './conversation-history';
4
- type ActionType = 'click' | 'drag' | 'type' | 'hotkey' | 'finished' | 'scroll' | 'wait';
4
+ type ActionType = 'click' | 'left_double' | 'right_single' | 'drag' | 'type' | 'hotkey' | 'finished' | 'scroll' | 'wait';
5
5
  export declare function uiTarsPlanning(userInstruction: string, options: {
6
6
  conversationHistory: ConversationHistory;
7
7
  context: UIContext;
8
8
  modelConfig: IModelConfig;
9
+ actionContext?: string;
9
10
  }): Promise<PlanningAIResponse>;
10
11
  interface BaseAction {
11
12
  action_type: ActionType;
@@ -32,6 +33,18 @@ interface WaitAction extends BaseAction {
32
33
  time: string;
33
34
  };
34
35
  }
36
+ interface LeftDoubleAction extends BaseAction {
37
+ action_type: 'left_double';
38
+ action_inputs: {
39
+ start_box: string;
40
+ };
41
+ }
42
+ interface RightSingleAction extends BaseAction {
43
+ action_type: 'right_single';
44
+ action_inputs: {
45
+ start_box: string;
46
+ };
47
+ }
35
48
  interface TypeAction extends BaseAction {
36
49
  action_type: 'type';
37
50
  action_inputs: {
@@ -54,6 +67,6 @@ interface FinishedAction extends BaseAction {
54
67
  action_type: 'finished';
55
68
  action_inputs: Record<string, never>;
56
69
  }
57
- export type Action = ClickAction | DragAction | TypeAction | HotkeyAction | ScrollAction | FinishedAction | WaitAction;
70
+ export type Action = ClickAction | LeftDoubleAction | RightSingleAction | DragAction | TypeAction | HotkeyAction | ScrollAction | FinishedAction | WaitAction;
58
71
  export declare function resizeImageForUiTars(imageBase64: string, size: Size, uiTarsVersion: UITarsModelVersion | undefined): Promise<string>;
59
72
  export {};
@@ -43,7 +43,30 @@ export interface MidsceneYamlTask {
43
43
  flow: MidsceneYamlFlowItem[];
44
44
  continueOnError?: boolean;
45
45
  }
46
- export type MidsceneYamlScriptAgentOpt = Pick<AgentOpt, 'aiActionContext' | 'cache'>;
46
+ /**
47
+ * Agent configuration options that can be specified in YAML scripts.
48
+ *
49
+ * This type includes serializable fields from AgentOpt, excluding non-serializable
50
+ * fields like functions and complex objects. All fields are optional.
51
+ *
52
+ * @remarks
53
+ * - testId priority: CLI parameter > YAML agent.testId > filename
54
+ * - These settings apply to all platforms (Web, Android, iOS, Generic Interface)
55
+ * - modelConfig is configured through environment variables, not in YAML
56
+ *
57
+ * @example
58
+ * ```yaml
59
+ * agent:
60
+ * testId: "checkout-test"
61
+ * groupName: "E2E Test Suite"
62
+ * generateReport: true
63
+ * replanningCycleLimit: 30
64
+ * cache:
65
+ * id: "checkout-cache"
66
+ * strategy: "read-write"
67
+ * ```
68
+ */
69
+ export type MidsceneYamlScriptAgentOpt = Pick<AgentOpt, 'testId' | 'groupName' | 'groupDescription' | 'generateReport' | 'autoPrintReportMsg' | 'reportFileName' | 'replanningCycleLimit' | 'aiActionContext' | 'cache'>;
47
70
  export interface MidsceneYamlScriptConfig {
48
71
  output?: string;
49
72
  unstableLogContent?: boolean | string;
@@ -67,6 +90,26 @@ export interface MidsceneYamlScriptWebEnv extends MidsceneYamlScriptConfig, Mids
67
90
  };
68
91
  cookie?: string;
69
92
  forceSameTabNavigation?: boolean;
93
+ /**
94
+ * Custom Chrome launch arguments (Puppeteer only, not supported in bridge mode).
95
+ *
96
+ * Allows passing custom command-line arguments to Chrome/Chromium when launching the browser.
97
+ * This is useful for testing scenarios that require specific browser configurations.
98
+ *
99
+ * ⚠️ Security Warning: Some arguments (e.g., --no-sandbox, --disable-web-security) may
100
+ * reduce browser security. Use only in controlled testing environments.
101
+ *
102
+ * @example
103
+ * ```yaml
104
+ * web:
105
+ * url: https://example.com
106
+ * chromeArgs:
107
+ * - '--disable-features=ThirdPartyCookiePhaseout'
108
+ * - '--disable-features=SameSiteByDefaultCookies'
109
+ * - '--window-size=1920,1080'
110
+ * ```
111
+ */
112
+ chromeArgs?: string[];
70
113
  bridgeMode?: false | 'newTabWithUrl' | 'currentTab';
71
114
  closeNewTabsAfterDisconnect?: boolean;
72
115
  }
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": "1.0.1-beta-20251202152706.0",
4
+ "version": "1.0.1-beta-20251203073716.0",
5
5
  "repository": "https://github.com/web-infra-dev/midscene",
6
6
  "homepage": "https://midscenejs.com/",
7
7
  "main": "./dist/lib/index.js",
@@ -89,7 +89,7 @@
89
89
  "js-yaml": "4.1.0",
90
90
  "zod": "3.24.3",
91
91
  "socks-proxy-agent": "8.0.4",
92
- "@midscene/shared": "1.0.1-beta-20251202152706.0"
92
+ "@midscene/shared": "1.0.1-beta-20251203073716.0"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@rslib/core": "^0.18.2",