@midscene/web 0.8.6 → 0.8.7
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/appium.js +81 -27
- package/dist/es/chrome-extension.js +73 -33
- package/dist/es/index.js +103 -33
- package/dist/es/midscene-playground.js +65 -23
- package/dist/es/playground.js +65 -23
- package/dist/es/playwright.js +71 -25
- package/dist/es/puppeteer.js +71 -25
- package/dist/es/ui-utils.js +7 -2
- package/dist/lib/appium.js +81 -27
- package/dist/lib/chrome-extension.js +73 -33
- package/dist/lib/index.js +103 -33
- package/dist/lib/midscene-playground.js +65 -23
- package/dist/lib/playground.js +65 -23
- package/dist/lib/playwright.js +71 -25
- package/dist/lib/puppeteer.js +71 -25
- package/dist/lib/ui-utils.js +7 -2
- package/dist/types/appium.d.ts +3 -3
- package/dist/types/chrome-extension.d.ts +4 -4
- package/dist/types/debug.d.ts +2 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/{page-a10cd0ea.d.ts → page-b9196527.d.ts} +34 -14
- package/dist/types/playground.d.ts +4 -4
- package/dist/types/playwright.d.ts +4 -4
- package/dist/types/puppeteer.d.ts +3 -3
- package/dist/types/{tasks-15aa1c35.d.ts → tasks-969c0e3e.d.ts} +3 -3
- package/dist/types/utils.d.ts +2 -2
- package/package.json +3 -3
package/dist/lib/playwright.js
CHANGED
|
@@ -721,26 +721,42 @@ var PageTaskExecutor = class {
|
|
|
721
721
|
param: plan2.param,
|
|
722
722
|
thought: plan2.thought,
|
|
723
723
|
locate: plan2.locate,
|
|
724
|
-
executor: async (taskParam) => {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
724
|
+
executor: async (taskParam, { element }) => {
|
|
725
|
+
if (element) {
|
|
726
|
+
await this.page.mouse.move(
|
|
727
|
+
element.center[0],
|
|
728
|
+
element.center[1]
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
const scrollToEventName = taskParam == null ? void 0 : taskParam.scrollType;
|
|
732
|
+
if (scrollToEventName === "untilTop") {
|
|
733
|
+
await this.page.scrollUntilTop();
|
|
734
|
+
} else if (scrollToEventName === "untilBottom") {
|
|
735
|
+
await this.page.scrollUntilBottom();
|
|
736
|
+
} else if (scrollToEventName === "untilRight") {
|
|
737
|
+
await this.page.scrollUntilRight();
|
|
738
|
+
} else if (scrollToEventName === "untilLeft") {
|
|
739
|
+
await this.page.scrollUntilLeft();
|
|
740
|
+
} else if (scrollToEventName === "once") {
|
|
741
|
+
if (taskParam.direction === "down") {
|
|
742
|
+
await this.page.scrollDown(taskParam.distance || void 0);
|
|
743
|
+
} else if (taskParam.direction === "up") {
|
|
744
|
+
await this.page.scrollUp(taskParam.distance || void 0);
|
|
745
|
+
} else if (taskParam.direction === "left") {
|
|
746
|
+
await this.page.scrollLeft(taskParam.distance || void 0);
|
|
747
|
+
} else if (taskParam.direction === "right") {
|
|
748
|
+
await this.page.scrollRight(taskParam.distance || void 0);
|
|
749
|
+
} else {
|
|
750
|
+
throw new Error(
|
|
751
|
+
`Unknown scroll direction: ${taskParam.direction}`
|
|
743
752
|
);
|
|
753
|
+
}
|
|
754
|
+
} else {
|
|
755
|
+
throw new Error(
|
|
756
|
+
`Unknown scroll event type: ${scrollToEventName}, taskParam: ${JSON.stringify(
|
|
757
|
+
taskParam
|
|
758
|
+
)}`
|
|
759
|
+
);
|
|
744
760
|
}
|
|
745
761
|
}
|
|
746
762
|
};
|
|
@@ -769,6 +785,17 @@ var PageTaskExecutor = class {
|
|
|
769
785
|
}
|
|
770
786
|
};
|
|
771
787
|
tasks.push(taskActionError);
|
|
788
|
+
} else if (plan2.type === "FalsyConditionStatement") {
|
|
789
|
+
const taskActionFalsyConditionStatement = {
|
|
790
|
+
type: "Action",
|
|
791
|
+
subType: "FalsyConditionStatement",
|
|
792
|
+
param: null,
|
|
793
|
+
thought: plan2.thought,
|
|
794
|
+
locate: plan2.locate,
|
|
795
|
+
executor: async () => {
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
tasks.push(taskActionFalsyConditionStatement);
|
|
772
799
|
} else {
|
|
773
800
|
throw new Error(`Unknown or unsupported task type: ${plan2.type}`);
|
|
774
801
|
}
|
|
@@ -888,6 +915,9 @@ var PageTaskExecutor = class {
|
|
|
888
915
|
const errorMsg = "Replanning too many times, please split the task into multiple steps";
|
|
889
916
|
return this.appendErrorPlan(taskExecutor, errorMsg);
|
|
890
917
|
}
|
|
918
|
+
if (replanCount > 0) {
|
|
919
|
+
await (0, import_utils3.sleep)(300);
|
|
920
|
+
}
|
|
891
921
|
await taskExecutor.append(planningTask);
|
|
892
922
|
const planResult = await taskExecutor.flush();
|
|
893
923
|
if (taskExecutor.isInErrorState()) {
|
|
@@ -1573,15 +1603,31 @@ var Page = class {
|
|
|
1573
1603
|
scrollUntilBottom() {
|
|
1574
1604
|
return this.mouse.wheel(0, 9999999);
|
|
1575
1605
|
}
|
|
1576
|
-
|
|
1606
|
+
scrollUntilLeft() {
|
|
1607
|
+
return this.mouse.wheel(-9999999, 0);
|
|
1608
|
+
}
|
|
1609
|
+
scrollUntilRight() {
|
|
1610
|
+
return this.mouse.wheel(9999999, 0);
|
|
1611
|
+
}
|
|
1612
|
+
async scrollUp(distance) {
|
|
1577
1613
|
const innerHeight = await this.evaluate(() => window.innerHeight);
|
|
1578
|
-
const
|
|
1579
|
-
await this.mouse.wheel(0, -
|
|
1614
|
+
const scrollDistance = distance || innerHeight * 0.7;
|
|
1615
|
+
await this.mouse.wheel(0, -scrollDistance);
|
|
1580
1616
|
}
|
|
1581
|
-
async
|
|
1617
|
+
async scrollDown(distance) {
|
|
1582
1618
|
const innerHeight = await this.evaluate(() => window.innerHeight);
|
|
1583
|
-
const
|
|
1584
|
-
await this.mouse.wheel(0,
|
|
1619
|
+
const scrollDistance = distance || innerHeight * 0.7;
|
|
1620
|
+
await this.mouse.wheel(0, scrollDistance);
|
|
1621
|
+
}
|
|
1622
|
+
async scrollLeft(distance) {
|
|
1623
|
+
const innerWidth = await this.evaluate(() => window.innerWidth);
|
|
1624
|
+
const scrollDistance = distance || innerWidth * 0.7;
|
|
1625
|
+
await this.mouse.wheel(-scrollDistance, 0);
|
|
1626
|
+
}
|
|
1627
|
+
async scrollRight(distance) {
|
|
1628
|
+
const innerWidth = await this.evaluate(() => window.innerWidth);
|
|
1629
|
+
const scrollDistance = distance || innerWidth * 0.7;
|
|
1630
|
+
await this.mouse.wheel(scrollDistance, 0);
|
|
1585
1631
|
}
|
|
1586
1632
|
async destroy() {
|
|
1587
1633
|
}
|
package/dist/lib/puppeteer.js
CHANGED
|
@@ -717,26 +717,42 @@ var PageTaskExecutor = class {
|
|
|
717
717
|
param: plan2.param,
|
|
718
718
|
thought: plan2.thought,
|
|
719
719
|
locate: plan2.locate,
|
|
720
|
-
executor: async (taskParam) => {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
720
|
+
executor: async (taskParam, { element }) => {
|
|
721
|
+
if (element) {
|
|
722
|
+
await this.page.mouse.move(
|
|
723
|
+
element.center[0],
|
|
724
|
+
element.center[1]
|
|
725
|
+
);
|
|
726
|
+
}
|
|
727
|
+
const scrollToEventName = taskParam == null ? void 0 : taskParam.scrollType;
|
|
728
|
+
if (scrollToEventName === "untilTop") {
|
|
729
|
+
await this.page.scrollUntilTop();
|
|
730
|
+
} else if (scrollToEventName === "untilBottom") {
|
|
731
|
+
await this.page.scrollUntilBottom();
|
|
732
|
+
} else if (scrollToEventName === "untilRight") {
|
|
733
|
+
await this.page.scrollUntilRight();
|
|
734
|
+
} else if (scrollToEventName === "untilLeft") {
|
|
735
|
+
await this.page.scrollUntilLeft();
|
|
736
|
+
} else if (scrollToEventName === "once") {
|
|
737
|
+
if (taskParam.direction === "down") {
|
|
738
|
+
await this.page.scrollDown(taskParam.distance || void 0);
|
|
739
|
+
} else if (taskParam.direction === "up") {
|
|
740
|
+
await this.page.scrollUp(taskParam.distance || void 0);
|
|
741
|
+
} else if (taskParam.direction === "left") {
|
|
742
|
+
await this.page.scrollLeft(taskParam.distance || void 0);
|
|
743
|
+
} else if (taskParam.direction === "right") {
|
|
744
|
+
await this.page.scrollRight(taskParam.distance || void 0);
|
|
745
|
+
} else {
|
|
746
|
+
throw new Error(
|
|
747
|
+
`Unknown scroll direction: ${taskParam.direction}`
|
|
739
748
|
);
|
|
749
|
+
}
|
|
750
|
+
} else {
|
|
751
|
+
throw new Error(
|
|
752
|
+
`Unknown scroll event type: ${scrollToEventName}, taskParam: ${JSON.stringify(
|
|
753
|
+
taskParam
|
|
754
|
+
)}`
|
|
755
|
+
);
|
|
740
756
|
}
|
|
741
757
|
}
|
|
742
758
|
};
|
|
@@ -765,6 +781,17 @@ var PageTaskExecutor = class {
|
|
|
765
781
|
}
|
|
766
782
|
};
|
|
767
783
|
tasks.push(taskActionError);
|
|
784
|
+
} else if (plan2.type === "FalsyConditionStatement") {
|
|
785
|
+
const taskActionFalsyConditionStatement = {
|
|
786
|
+
type: "Action",
|
|
787
|
+
subType: "FalsyConditionStatement",
|
|
788
|
+
param: null,
|
|
789
|
+
thought: plan2.thought,
|
|
790
|
+
locate: plan2.locate,
|
|
791
|
+
executor: async () => {
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
tasks.push(taskActionFalsyConditionStatement);
|
|
768
795
|
} else {
|
|
769
796
|
throw new Error(`Unknown or unsupported task type: ${plan2.type}`);
|
|
770
797
|
}
|
|
@@ -884,6 +911,9 @@ var PageTaskExecutor = class {
|
|
|
884
911
|
const errorMsg = "Replanning too many times, please split the task into multiple steps";
|
|
885
912
|
return this.appendErrorPlan(taskExecutor, errorMsg);
|
|
886
913
|
}
|
|
914
|
+
if (replanCount > 0) {
|
|
915
|
+
await (0, import_utils3.sleep)(300);
|
|
916
|
+
}
|
|
887
917
|
await taskExecutor.append(planningTask);
|
|
888
918
|
const planResult = await taskExecutor.flush();
|
|
889
919
|
if (taskExecutor.isInErrorState()) {
|
|
@@ -1417,15 +1447,31 @@ var Page = class {
|
|
|
1417
1447
|
scrollUntilBottom() {
|
|
1418
1448
|
return this.mouse.wheel(0, 9999999);
|
|
1419
1449
|
}
|
|
1420
|
-
|
|
1450
|
+
scrollUntilLeft() {
|
|
1451
|
+
return this.mouse.wheel(-9999999, 0);
|
|
1452
|
+
}
|
|
1453
|
+
scrollUntilRight() {
|
|
1454
|
+
return this.mouse.wheel(9999999, 0);
|
|
1455
|
+
}
|
|
1456
|
+
async scrollUp(distance) {
|
|
1421
1457
|
const innerHeight = await this.evaluate(() => window.innerHeight);
|
|
1422
|
-
const
|
|
1423
|
-
await this.mouse.wheel(0, -
|
|
1458
|
+
const scrollDistance = distance || innerHeight * 0.7;
|
|
1459
|
+
await this.mouse.wheel(0, -scrollDistance);
|
|
1424
1460
|
}
|
|
1425
|
-
async
|
|
1461
|
+
async scrollDown(distance) {
|
|
1426
1462
|
const innerHeight = await this.evaluate(() => window.innerHeight);
|
|
1427
|
-
const
|
|
1428
|
-
await this.mouse.wheel(0,
|
|
1463
|
+
const scrollDistance = distance || innerHeight * 0.7;
|
|
1464
|
+
await this.mouse.wheel(0, scrollDistance);
|
|
1465
|
+
}
|
|
1466
|
+
async scrollLeft(distance) {
|
|
1467
|
+
const innerWidth = await this.evaluate(() => window.innerWidth);
|
|
1468
|
+
const scrollDistance = distance || innerWidth * 0.7;
|
|
1469
|
+
await this.mouse.wheel(-scrollDistance, 0);
|
|
1470
|
+
}
|
|
1471
|
+
async scrollRight(distance) {
|
|
1472
|
+
const innerWidth = await this.evaluate(() => window.innerWidth);
|
|
1473
|
+
const scrollDistance = distance || innerWidth * 0.7;
|
|
1474
|
+
await this.mouse.wheel(scrollDistance, 0);
|
|
1429
1475
|
}
|
|
1430
1476
|
async destroy() {
|
|
1431
1477
|
}
|
package/dist/lib/ui-utils.js
CHANGED
|
@@ -28,7 +28,7 @@ function typeStr(task) {
|
|
|
28
28
|
return task.subType ? `${task.type} / ${task.subType || ""}` : task.type;
|
|
29
29
|
}
|
|
30
30
|
function paramStr(task) {
|
|
31
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
31
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
32
32
|
let value;
|
|
33
33
|
if (task.type === "Planning") {
|
|
34
34
|
value = (_a = task == null ? void 0 : task.param) == null ? void 0 : _a.userPrompt;
|
|
@@ -38,10 +38,15 @@ function paramStr(task) {
|
|
|
38
38
|
}
|
|
39
39
|
if (task.type === "Action") {
|
|
40
40
|
const sleepMs = (_f = task == null ? void 0 : task.param) == null ? void 0 : _f.timeMs;
|
|
41
|
+
const scrollType = (_g = task == null ? void 0 : task.param) == null ? void 0 : _g.scrollType;
|
|
41
42
|
if (sleepMs) {
|
|
42
43
|
value = `${sleepMs}ms`;
|
|
44
|
+
} else if (scrollType) {
|
|
45
|
+
const scrollDirection = (_h = task == null ? void 0 : task.param) == null ? void 0 : _h.direction;
|
|
46
|
+
const scrollDistance = (_i = task == null ? void 0 : task.param) == null ? void 0 : _i.distance;
|
|
47
|
+
value = `${scrollDirection}, ${scrollType}, ${scrollDistance || "distance-not-set"}`;
|
|
43
48
|
} else {
|
|
44
|
-
value = ((
|
|
49
|
+
value = ((_j = task == null ? void 0 : task.param) == null ? void 0 : _j.value) || ((_k = task == null ? void 0 : task.param) == null ? void 0 : _k.scrollType);
|
|
45
50
|
}
|
|
46
51
|
if (!value) {
|
|
47
52
|
value = task.thought;
|
package/dist/types/appium.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { P as AppiumAgent } from './tasks-
|
|
2
|
-
export { P as AppiumPage } from './page-
|
|
3
|
-
import '@midscene/core/dist/lib/types/types-
|
|
1
|
+
export { P as AppiumAgent } from './tasks-969c0e3e.js';
|
|
2
|
+
export { P as AppiumPage } from './page-b9196527.js';
|
|
3
|
+
import '@midscene/core/dist/lib/types/types-55182ae1';
|
|
4
4
|
import '@midscene/core';
|
|
5
5
|
import '@midscene/shared/fs';
|
|
6
6
|
import 'playwright';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { C as ChromeExtensionProxyPage } from './page-
|
|
2
|
-
export { b as ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED } from './page-
|
|
3
|
-
import { P as PageAgent } from './tasks-
|
|
1
|
+
import { C as ChromeExtensionProxyPage } from './page-b9196527.js';
|
|
2
|
+
export { b as ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED } from './page-b9196527.js';
|
|
3
|
+
import { P as PageAgent } from './tasks-969c0e3e.js';
|
|
4
4
|
import 'playwright';
|
|
5
5
|
import '@midscene/core/.';
|
|
6
6
|
import 'puppeteer';
|
|
7
7
|
import '@midscene/shared/constants';
|
|
8
8
|
import '@midscene/core';
|
|
9
|
-
import '@midscene/core/dist/lib/types/types-
|
|
9
|
+
import '@midscene/core/dist/lib/types/types-55182ae1';
|
|
10
10
|
import 'webdriverio';
|
|
11
11
|
import '@midscene/shared/fs';
|
|
12
12
|
|
package/dist/types/debug.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { writeFileSync } from 'node:fs';
|
|
2
|
-
import { W as WebPage, E as ElementInfo } from './page-
|
|
2
|
+
import { W as WebPage, E as ElementInfo } from './page-b9196527.js';
|
|
3
3
|
import 'playwright';
|
|
4
4
|
import '@midscene/core/.';
|
|
5
5
|
import 'puppeteer';
|
|
6
6
|
import '@midscene/shared/constants';
|
|
7
7
|
import '@midscene/core';
|
|
8
|
-
import '@midscene/core/dist/lib/types/types-
|
|
8
|
+
import '@midscene/core/dist/lib/types/types-55182ae1';
|
|
9
9
|
import 'webdriverio';
|
|
10
10
|
|
|
11
11
|
declare function generateExtractData(page: WebPage, targetDir: string, saveImgType?: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { PlayWrightAiFixtureType, PlaywrightAiFixture } from './playwright.js';
|
|
2
|
-
export { P as AppiumAgent, P as PlaywrightAgent } from './tasks-
|
|
3
|
-
export { P as AppiumPage } from './page-
|
|
2
|
+
export { P as AppiumAgent, P as PlaywrightAgent } from './tasks-969c0e3e.js';
|
|
3
|
+
export { P as AppiumPage } from './page-b9196527.js';
|
|
4
4
|
export { StaticPageAgent } from './playground.js';
|
|
5
5
|
export { PuppeteerAgent } from './puppeteer.js';
|
|
6
6
|
export { generateExtractData } from './debug.js';
|
|
@@ -8,7 +8,7 @@ import '@midscene/core/.';
|
|
|
8
8
|
import '@playwright/test';
|
|
9
9
|
import 'playwright';
|
|
10
10
|
import '@midscene/core';
|
|
11
|
-
import '@midscene/core/dist/lib/types/types-
|
|
11
|
+
import '@midscene/core/dist/lib/types/types-55182ae1';
|
|
12
12
|
import '@midscene/shared/fs';
|
|
13
13
|
import 'puppeteer';
|
|
14
14
|
import '@midscene/shared/constants';
|
|
@@ -3,7 +3,7 @@ import { Size } from '@midscene/core/.';
|
|
|
3
3
|
import { KeyInput, Page as Page$2 } from 'puppeteer';
|
|
4
4
|
import { NodeType } from '@midscene/shared/constants';
|
|
5
5
|
import { BaseElement, Rect, UIContext, PlaywrightParserOpt } from '@midscene/core';
|
|
6
|
-
import * as
|
|
6
|
+
import * as _midscene_core_dist_lib_types_types_55182ae1 from '@midscene/core/dist/lib/types/types-55182ae1';
|
|
7
7
|
import { Browser } from 'webdriverio';
|
|
8
8
|
|
|
9
9
|
declare class WebElementInfo implements BaseElement {
|
|
@@ -89,8 +89,12 @@ declare abstract class AbstractPage {
|
|
|
89
89
|
clearInput(element: ElementInfo): Promise<void>;
|
|
90
90
|
abstract scrollUntilTop(): Promise<void>;
|
|
91
91
|
abstract scrollUntilBottom(): Promise<void>;
|
|
92
|
-
abstract
|
|
93
|
-
abstract
|
|
92
|
+
abstract scrollUntilLeft(): Promise<void>;
|
|
93
|
+
abstract scrollUntilRight(): Promise<void>;
|
|
94
|
+
abstract scrollUp(distance?: number): Promise<void>;
|
|
95
|
+
abstract scrollDown(distance?: number): Promise<void>;
|
|
96
|
+
abstract scrollLeft(distance?: number): Promise<void>;
|
|
97
|
+
abstract scrollRight(distance?: number): Promise<void>;
|
|
94
98
|
abstract _forceUsePageContext?(): Promise<WebUIContext>;
|
|
95
99
|
abstract waitUntilNetworkIdle?(options?: {
|
|
96
100
|
idleTime?: number;
|
|
@@ -120,10 +124,14 @@ declare class Page$1 implements AbstractPage {
|
|
|
120
124
|
};
|
|
121
125
|
clearInput(element: ElementInfo): Promise<void>;
|
|
122
126
|
url(): string;
|
|
123
|
-
scrollUntilTop(): Promise<void>;
|
|
124
|
-
scrollUntilBottom(): Promise<void>;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
scrollUntilTop(distance?: number): Promise<void>;
|
|
128
|
+
scrollUntilBottom(distance?: number): Promise<void>;
|
|
129
|
+
scrollUntilLeft(distance?: number): Promise<void>;
|
|
130
|
+
scrollUntilRight(distance?: number): Promise<void>;
|
|
131
|
+
scrollUp(distance?: number): Promise<void>;
|
|
132
|
+
scrollDown(distance?: number): Promise<void>;
|
|
133
|
+
scrollLeft(distance?: number): Promise<void>;
|
|
134
|
+
scrollRight(distance?: number): Promise<void>;
|
|
127
135
|
private keyboardType;
|
|
128
136
|
private keyboardPress;
|
|
129
137
|
private mouseClick;
|
|
@@ -150,8 +158,12 @@ declare class ChromeExtensionProxyPage implements AbstractPage {
|
|
|
150
158
|
url(): Promise<string>;
|
|
151
159
|
scrollUntilTop(): Promise<void>;
|
|
152
160
|
scrollUntilBottom(): Promise<void>;
|
|
153
|
-
|
|
154
|
-
|
|
161
|
+
scrollUntilLeft(): Promise<void>;
|
|
162
|
+
scrollUntilRight(): Promise<void>;
|
|
163
|
+
scrollUp(distance?: number): Promise<void>;
|
|
164
|
+
scrollDown(distance?: number): Promise<void>;
|
|
165
|
+
scrollLeft(distance?: number): Promise<void>;
|
|
166
|
+
scrollRight(distance?: number): Promise<void>;
|
|
155
167
|
clearInput(element: ElementInfo): Promise<void>;
|
|
156
168
|
mouse: {
|
|
157
169
|
click: (x: number, y: number) => Promise<void>;
|
|
@@ -170,13 +182,17 @@ declare class StaticPage implements AbstractPage {
|
|
|
170
182
|
private uiContext;
|
|
171
183
|
constructor(uiContext: WebUIContext);
|
|
172
184
|
getElementInfos(): Promise<any>;
|
|
173
|
-
size(): Promise<
|
|
185
|
+
size(): Promise<_midscene_core_dist_lib_types_types_55182ae1.S>;
|
|
174
186
|
screenshotBase64(): Promise<string>;
|
|
175
187
|
url(): Promise<string>;
|
|
176
188
|
scrollUntilTop(): Promise<any>;
|
|
177
189
|
scrollUntilBottom(): Promise<any>;
|
|
178
|
-
|
|
179
|
-
|
|
190
|
+
scrollUntilLeft(): Promise<any>;
|
|
191
|
+
scrollUntilRight(): Promise<any>;
|
|
192
|
+
scrollUp(distance?: number): Promise<any>;
|
|
193
|
+
scrollDown(distance?: number): Promise<any>;
|
|
194
|
+
scrollLeft(distance?: number): Promise<any>;
|
|
195
|
+
scrollRight(distance?: number): Promise<any>;
|
|
180
196
|
clearInput(): Promise<any>;
|
|
181
197
|
mouse: {
|
|
182
198
|
click: any;
|
|
@@ -217,8 +233,12 @@ declare class Page<AgentType extends 'puppeteer' | 'playwright', PageType extend
|
|
|
217
233
|
clearInput(element: ElementInfo): Promise<void>;
|
|
218
234
|
scrollUntilTop(): Promise<void>;
|
|
219
235
|
scrollUntilBottom(): Promise<void>;
|
|
220
|
-
|
|
221
|
-
|
|
236
|
+
scrollUntilLeft(): Promise<void>;
|
|
237
|
+
scrollUntilRight(): Promise<void>;
|
|
238
|
+
scrollUp(distance?: number): Promise<void>;
|
|
239
|
+
scrollDown(distance?: number): Promise<void>;
|
|
240
|
+
scrollLeft(distance?: number): Promise<void>;
|
|
241
|
+
scrollRight(distance?: number): Promise<void>;
|
|
222
242
|
destroy(): Promise<void>;
|
|
223
243
|
}
|
|
224
244
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { S as StaticPage } from './page-
|
|
2
|
-
export { b as ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED } from './page-
|
|
3
|
-
import { P as PageAgent } from './tasks-
|
|
1
|
+
import { S as StaticPage } from './page-b9196527.js';
|
|
2
|
+
export { b as ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED } from './page-b9196527.js';
|
|
3
|
+
import { P as PageAgent } from './tasks-969c0e3e.js';
|
|
4
4
|
import 'playwright';
|
|
5
5
|
import '@midscene/core/.';
|
|
6
6
|
import 'puppeteer';
|
|
7
7
|
import '@midscene/shared/constants';
|
|
8
8
|
import '@midscene/core';
|
|
9
|
-
import '@midscene/core/dist/lib/types/types-
|
|
9
|
+
import '@midscene/core/dist/lib/types/types-55182ae1';
|
|
10
10
|
import 'webdriverio';
|
|
11
11
|
import '@midscene/shared/fs';
|
|
12
12
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AgentWaitForOpt } from '@midscene/core/.';
|
|
2
2
|
import { TestInfo } from '@playwright/test';
|
|
3
3
|
import { Page } from 'playwright';
|
|
4
|
-
import { b as PageTaskExecutor } from './tasks-
|
|
5
|
-
export { P as PlaywrightAgent } from './tasks-
|
|
6
|
-
export { c as PlaywrightWebPage } from './page-
|
|
4
|
+
import { b as PageTaskExecutor } from './tasks-969c0e3e.js';
|
|
5
|
+
export { P as PlaywrightAgent } from './tasks-969c0e3e.js';
|
|
6
|
+
export { c as PlaywrightWebPage } from './page-b9196527.js';
|
|
7
7
|
export { overrideAIConfig } from '@midscene/core';
|
|
8
|
-
import '@midscene/core/dist/lib/types/types-
|
|
8
|
+
import '@midscene/core/dist/lib/types/types-55182ae1';
|
|
9
9
|
import '@midscene/shared/fs';
|
|
10
10
|
import 'puppeteer';
|
|
11
11
|
import '@midscene/shared/constants';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as PageAgent, a as PageAgentOpt } from './tasks-
|
|
1
|
+
import { P as PageAgent, a as PageAgentOpt } from './tasks-969c0e3e.js';
|
|
2
2
|
import { Page } from 'puppeteer';
|
|
3
|
-
export { a as PuppeteerWebPage } from './page-
|
|
3
|
+
export { a as PuppeteerWebPage } from './page-b9196527.js';
|
|
4
4
|
export { overrideAIConfig } from '@midscene/core';
|
|
5
|
-
import '@midscene/core/dist/lib/types/types-
|
|
5
|
+
import '@midscene/core/dist/lib/types/types-55182ae1';
|
|
6
6
|
import '@midscene/shared/fs';
|
|
7
7
|
import 'playwright';
|
|
8
8
|
import '@midscene/core/.';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { d as WebUIContext, W as WebPage, e as WebElementInfo } from './page-
|
|
1
|
+
import * as _midscene_core_dist_lib_types_types_55182ae1 from '@midscene/core/dist/lib/types/types-55182ae1';
|
|
2
|
+
import { d as WebUIContext, W as WebPage, e as WebElementInfo } from './page-b9196527.js';
|
|
3
3
|
import { PlanningAIResponse, AIElementIdResponse, Insight, GroupedActionDump, InsightAction, ExecutionDump, ExecutionTaskProgressOptions, AgentAssertOpt, AgentWaitForOpt, InsightExtractParam, InsightAssertionResponse, PlanningActionParamWaitFor, Executor } from '@midscene/core';
|
|
4
4
|
import { getRunningPkgInfo } from '@midscene/shared/fs';
|
|
5
5
|
|
|
@@ -107,7 +107,7 @@ declare class PageAgent {
|
|
|
107
107
|
writeOutActionDumps(): void;
|
|
108
108
|
aiAction(taskPrompt: string, options?: ExecutionTaskProgressOptions): Promise<void>;
|
|
109
109
|
aiQuery(demand: any): Promise<any>;
|
|
110
|
-
aiAssert(assertion: string, msg?: string, opt?: AgentAssertOpt): Promise<
|
|
110
|
+
aiAssert(assertion: string, msg?: string, opt?: AgentAssertOpt): Promise<_midscene_core_dist_lib_types_types_55182ae1.o | undefined>;
|
|
111
111
|
aiWaitFor(assertion: string, opt?: AgentWaitForOpt): Promise<void>;
|
|
112
112
|
ai(taskPrompt: string, type?: string): Promise<any>;
|
|
113
113
|
destroy(): Promise<void>;
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '@midscene/core';
|
|
2
|
-
export { b as ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED, d as WebUIContext, i as generateCacheId, h as getCurrentExecutionFile, g as getExtraReturnLogic, p as parseContextFromWebPage, f as printReportMsg, r as reportFileName } from './page-
|
|
2
|
+
export { b as ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED, d as WebUIContext, i as generateCacheId, h as getCurrentExecutionFile, g as getExtraReturnLogic, p as parseContextFromWebPage, f as printReportMsg, r as reportFileName } from './page-b9196527.js';
|
|
3
3
|
import 'playwright';
|
|
4
4
|
import '@midscene/core/.';
|
|
5
5
|
import 'puppeteer';
|
|
6
6
|
import '@midscene/shared/constants';
|
|
7
|
-
import '@midscene/core/dist/lib/types/types-
|
|
7
|
+
import '@midscene/core/dist/lib/types/types-55182ae1';
|
|
8
8
|
import 'webdriverio';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/web",
|
|
3
3
|
"description": "An AI-powered automation SDK can control the page, perform assertions, and extract data in JSON format using natural language. See https://midscenejs.com/ for details.",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.7",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"jsnext:source": "./src/index.ts",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"express": "4.21.1",
|
|
73
73
|
"inquirer": "10.1.5",
|
|
74
74
|
"openai": "4.57.1",
|
|
75
|
-
"@midscene/
|
|
76
|
-
"@midscene/
|
|
75
|
+
"@midscene/shared": "0.8.7",
|
|
76
|
+
"@midscene/core": "0.8.7"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@modern-js/module-tools": "2.60.6",
|