@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.
- package/dist/es/agent/agent.mjs +5 -4
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/task-builder.mjs +9 -5
- package/dist/es/agent/task-builder.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/ai-model/service-caller/index.mjs +4 -1
- package/dist/es/ai-model/service-caller/index.mjs.map +1 -1
- package/dist/es/ai-model/ui-tars-planning.mjs +68 -7
- package/dist/es/ai-model/ui-tars-planning.mjs.map +1 -1
- package/dist/es/utils.mjs +2 -2
- package/dist/lib/agent/agent.js +5 -4
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/task-builder.js +9 -5
- package/dist/lib/agent/task-builder.js.map +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/ai-model/service-caller/index.js +4 -1
- package/dist/lib/ai-model/service-caller/index.js.map +1 -1
- package/dist/lib/ai-model/ui-tars-planning.js +68 -7
- package/dist/lib/ai-model/ui-tars-planning.js.map +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/types/ai-model/ui-tars-planning.d.ts +15 -2
- package/dist/types/yaml.d.ts +44 -1
- package/package.json +2 -2
|
@@ -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 {};
|
package/dist/types/yaml.d.ts
CHANGED
|
@@ -43,7 +43,30 @@ export interface MidsceneYamlTask {
|
|
|
43
43
|
flow: MidsceneYamlFlowItem[];
|
|
44
44
|
continueOnError?: boolean;
|
|
45
45
|
}
|
|
46
|
-
|
|
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-
|
|
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-
|
|
92
|
+
"@midscene/shared": "1.0.1-beta-20251203073716.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@rslib/core": "^0.18.2",
|