@midscene/core 1.8.5-beta-20260525033347.0 → 1.8.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/dist/es/agent/agent.mjs +14 -12
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/ai-model/service-caller/index.mjs +2 -2
- package/dist/es/ai-model/service-caller/index.mjs.map +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/report-cli.mjs +91 -10
- package/dist/es/report-cli.mjs.map +1 -1
- package/dist/es/report.mjs +5 -2
- package/dist/es/report.mjs.map +1 -1
- package/dist/es/utils.mjs +2 -2
- package/dist/lib/agent/agent.js +14 -12
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/ai-model/service-caller/index.js +1 -1
- package/dist/lib/ai-model/service-caller/index.js.map +1 -1
- package/dist/lib/index.js +3 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/report-cli.js +92 -8
- package/dist/lib/report-cli.js.map +1 -1
- package/dist/lib/report.js +5 -2
- package/dist/lib/report.js.map +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/types/agent/agent.d.ts +15 -14
- package/dist/types/device/device-options.d.ts +0 -10
- package/dist/types/index.d.ts +1 -1
- package/dist/types/report-cli.d.ts +11 -1
- package/dist/types/report.d.ts +1 -0
- package/package.json +5 -5
|
@@ -83,17 +83,17 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
|
|
|
83
83
|
callActionInActionSpace<T = any>(type: string, opt?: T): Promise<any>;
|
|
84
84
|
aiTap(locatePrompt: TUserPrompt, opt?: LocateOption & {
|
|
85
85
|
fileChooserAccept?: string | string[];
|
|
86
|
-
}): Promise<
|
|
87
|
-
aiRightClick(locatePrompt: TUserPrompt, opt?: LocateOption): Promise<
|
|
88
|
-
aiDoubleClick(locatePrompt: TUserPrompt, opt?: LocateOption): Promise<
|
|
89
|
-
aiHover(locatePrompt: TUserPrompt, opt?: LocateOption): Promise<
|
|
86
|
+
}): Promise<void>;
|
|
87
|
+
aiRightClick(locatePrompt: TUserPrompt, opt?: LocateOption): Promise<void>;
|
|
88
|
+
aiDoubleClick(locatePrompt: TUserPrompt, opt?: LocateOption): Promise<void>;
|
|
89
|
+
aiHover(locatePrompt: TUserPrompt, opt?: LocateOption): Promise<void>;
|
|
90
90
|
aiInput(locatePrompt: TUserPrompt, opt: LocateOption & {
|
|
91
91
|
value: string | number;
|
|
92
92
|
} & {
|
|
93
93
|
autoDismissKeyboard?: boolean;
|
|
94
94
|
} & {
|
|
95
95
|
mode?: 'replace' | 'clear' | 'typeOnly' | 'append';
|
|
96
|
-
}): Promise<
|
|
96
|
+
}): Promise<void>;
|
|
97
97
|
/**
|
|
98
98
|
* @deprecated Use aiInput(locatePrompt, opt) instead where opt contains the value
|
|
99
99
|
*/
|
|
@@ -101,28 +101,28 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
|
|
|
101
101
|
autoDismissKeyboard?: boolean;
|
|
102
102
|
} & {
|
|
103
103
|
mode?: 'replace' | 'clear' | 'typeOnly' | 'append';
|
|
104
|
-
}): Promise<
|
|
104
|
+
}): Promise<void>;
|
|
105
105
|
aiKeyboardPress(locatePrompt: TUserPrompt, opt: LocateOption & {
|
|
106
106
|
keyName: string;
|
|
107
|
-
}): Promise<
|
|
107
|
+
}): Promise<void>;
|
|
108
108
|
/**
|
|
109
109
|
* @deprecated Use aiKeyboardPress(locatePrompt, opt) instead where opt contains the keyName
|
|
110
110
|
*/
|
|
111
|
-
aiKeyboardPress(keyName: string, locatePrompt?: TUserPrompt, opt?: LocateOption): Promise<
|
|
112
|
-
aiScroll(locatePrompt: TUserPrompt | undefined, opt: LocateOption & ScrollParam): Promise<
|
|
111
|
+
aiKeyboardPress(keyName: string, locatePrompt?: TUserPrompt, opt?: LocateOption): Promise<void>;
|
|
112
|
+
aiScroll(locatePrompt: TUserPrompt | undefined, opt: LocateOption & ScrollParam): Promise<void>;
|
|
113
113
|
/**
|
|
114
114
|
* @deprecated Use aiScroll(locatePrompt, opt) instead where opt contains the scroll parameters
|
|
115
115
|
*/
|
|
116
|
-
aiScroll(scrollParam: ScrollParam, locatePrompt?: TUserPrompt, opt?: LocateOption): Promise<
|
|
116
|
+
aiScroll(scrollParam: ScrollParam, locatePrompt?: TUserPrompt, opt?: LocateOption): Promise<void>;
|
|
117
117
|
aiPinch(locatePrompt: TUserPrompt | undefined, opt: LocateOption & {
|
|
118
118
|
direction: 'in' | 'out';
|
|
119
119
|
distance?: number;
|
|
120
120
|
duration?: number;
|
|
121
|
-
}): Promise<
|
|
121
|
+
}): Promise<void>;
|
|
122
122
|
aiLongPress(locatePrompt: TUserPrompt, opt?: LocateOption & {
|
|
123
123
|
duration?: number;
|
|
124
|
-
}): Promise<
|
|
125
|
-
aiClearInput(locatePrompt: TUserPrompt, opt?: LocateOption): Promise<
|
|
124
|
+
}): Promise<void>;
|
|
125
|
+
aiClearInput(locatePrompt: TUserPrompt, opt?: LocateOption): Promise<void>;
|
|
126
126
|
aiAct(taskPrompt: string, opt?: AiActOptions): Promise<string | undefined>;
|
|
127
127
|
/**
|
|
128
128
|
* @deprecated Use {@link Agent.aiAct} instead.
|
|
@@ -180,7 +180,8 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
|
|
|
180
180
|
clearDumpUpdateListeners(): void;
|
|
181
181
|
destroy(): Promise<void>;
|
|
182
182
|
recordToReport(title?: string, opt?: {
|
|
183
|
-
content
|
|
183
|
+
content?: string;
|
|
184
|
+
screenshotBase64?: string;
|
|
184
185
|
}): Promise<void>;
|
|
185
186
|
/**
|
|
186
187
|
* @deprecated Use {@link Agent.recordToReport} instead.
|
|
@@ -109,16 +109,6 @@ export type AndroidDeviceOpt = {
|
|
|
109
109
|
export type IOSDeviceInputOpt = {
|
|
110
110
|
/** Automatically dismiss the keyboard after input is completed */
|
|
111
111
|
autoDismissKeyboard?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Per-character delay (ms) used when typing into iOS input fields. When set
|
|
114
|
-
* to a positive number, characters are dispatched to WebDriverAgent one at a
|
|
115
|
-
* time with this gap between them, which prevents app-side reaction windows
|
|
116
|
-
* (re-render, predictive bar, autocorrect) from swallowing a contiguous
|
|
117
|
-
* block of keystrokes. Set to 0 to send the whole string in a single
|
|
118
|
-
* `/wda/keys` request (faster, but lossy on slow-reacting inputs).
|
|
119
|
-
* @default 80
|
|
120
|
-
*/
|
|
121
|
-
keyboardTypeDelay?: number;
|
|
122
112
|
};
|
|
123
113
|
/**
|
|
124
114
|
* iOS device options
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { restoreImageReferences, escapeContent, unescapeContent, parseImageScrip
|
|
|
15
15
|
export type { IReportGenerator } from './report-generator';
|
|
16
16
|
export { ReportGenerator, nullReportGenerator } from './report-generator';
|
|
17
17
|
export { collectDedupedExecutions, ReportMergingTool, dedupeExecutionsKeepLatest, splitReportHtmlByExecution, } from './report';
|
|
18
|
-
export { createReportCliCommands, reportFileToMarkdown, splitReportFile, type ConsumeReportFileAction, type ReportFileToMarkdownOptions, type ReportCliCommandDefinition, type ReportCliCommandEntry, type SplitReportFileOptions, } from './report-cli';
|
|
18
|
+
export { createReportCliCommands, reportFileToMarkdown, splitReportFile, mergeReportFiles, type ConsumeReportFileAction, type ReportFileToMarkdownOptions, type ReportCliCommandDefinition, type ReportCliCommandEntry, type SplitReportFileOptions, type MergeReportFilesOptions, type MergeReportFilesResult, } from './report-cli';
|
|
19
19
|
export { ScreenshotItem } from './screenshot-item';
|
|
20
20
|
export { ScreenshotStore, type ScreenshotRef } from './dump/screenshot-store';
|
|
21
21
|
export { executionToMarkdown, reportToMarkdown, type ExecutionMarkdownOptions, type ExecutionMarkdownResult, type ReportMarkdownResult, type MarkdownAttachment, } from './report-markdown';
|
|
@@ -17,13 +17,22 @@ export interface ReportCliCommandEntry {
|
|
|
17
17
|
name: string;
|
|
18
18
|
def: ReportCliCommandDefinition;
|
|
19
19
|
}
|
|
20
|
-
export type ConsumeReportFileAction = 'split' | 'to-markdown';
|
|
20
|
+
export type ConsumeReportFileAction = 'split' | 'to-markdown' | 'merge-html';
|
|
21
21
|
export interface ConsumeReportFileOptions {
|
|
22
22
|
htmlPath: string;
|
|
23
23
|
outputDir: string;
|
|
24
24
|
}
|
|
25
25
|
export type SplitReportFileOptions = ConsumeReportFileOptions;
|
|
26
26
|
export type ReportFileToMarkdownOptions = ConsumeReportFileOptions;
|
|
27
|
+
export interface MergeReportFilesOptions {
|
|
28
|
+
htmlPaths: string[];
|
|
29
|
+
outputDir?: string;
|
|
30
|
+
outputName?: string;
|
|
31
|
+
overwrite?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface MergeReportFilesResult {
|
|
34
|
+
mergedReportPath: string;
|
|
35
|
+
}
|
|
27
36
|
export declare function splitReportFile(options: SplitReportFileOptions): {
|
|
28
37
|
executionJsonFiles: string[];
|
|
29
38
|
screenshotFiles: string[];
|
|
@@ -32,5 +41,6 @@ export declare function reportFileToMarkdown(options: ReportFileToMarkdownOption
|
|
|
32
41
|
markdownFiles: string[];
|
|
33
42
|
screenshotFiles: string[];
|
|
34
43
|
}>;
|
|
44
|
+
export declare function mergeReportFiles(options: MergeReportFilesOptions): MergeReportFilesResult;
|
|
35
45
|
export declare function createReportCliCommands(): ReportCliCommandEntry[];
|
|
36
46
|
export {};
|
package/dist/types/report.d.ts
CHANGED
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.8.5
|
|
4
|
+
"version": "1.8.5",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"main": "./dist/lib/index.js",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"semver": "7.5.2",
|
|
98
98
|
"undici": "^6.0.0",
|
|
99
99
|
"zod": "^3.25.1",
|
|
100
|
-
"@midscene/shared": "1.8.5
|
|
100
|
+
"@midscene/shared": "1.8.5"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@rslib/core": "^0.18.3",
|
|
@@ -123,8 +123,8 @@
|
|
|
123
123
|
"build:watch": "USE_DEV_REPORT=1 rslib build --watch --no-clean",
|
|
124
124
|
"test": "vitest --run",
|
|
125
125
|
"test:u": "vitest --run -u",
|
|
126
|
-
"test:ai": "AITEST=true
|
|
127
|
-
"computer": "TEST_COMPUTER=true
|
|
128
|
-
"test:parse-action": "
|
|
126
|
+
"test:ai": "AITEST=true vitest --run",
|
|
127
|
+
"computer": "TEST_COMPUTER=true AITEST=true vitest --run tests/ai/evaluate/computer.test.ts",
|
|
128
|
+
"test:parse-action": "vitest --run tests/unit-test/parse-action.test.ts"
|
|
129
129
|
}
|
|
130
130
|
}
|