@midscene/web 0.26.2-beta-20250812035614.0 → 0.26.2
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.js +18 -13
- package/dist/es/agent.js.map +1 -1
- package/dist/es/bridge-mode-browser.js +64 -3
- package/dist/es/bridge-mode-browser.js.map +1 -1
- package/dist/es/bridge-mode.js +20 -15
- package/dist/es/bridge-mode.js.map +1 -1
- package/dist/es/chrome-extension.js +80 -14
- package/dist/es/chrome-extension.js.map +1 -1
- package/dist/es/index.js +82 -13
- package/dist/es/index.js.map +1 -1
- package/dist/es/midscene-playground.js +21 -13
- package/dist/es/midscene-playground.js.map +1 -1
- package/dist/es/playground.js +21 -13
- package/dist/es/playground.js.map +1 -1
- package/dist/es/playwright.js +81 -13
- package/dist/es/playwright.js.map +1 -1
- package/dist/es/puppeteer-agent-launcher.js +81 -13
- package/dist/es/puppeteer-agent-launcher.js.map +1 -1
- package/dist/es/puppeteer.js +81 -13
- package/dist/es/puppeteer.js.map +1 -1
- package/dist/lib/agent.js +18 -13
- package/dist/lib/agent.js.map +1 -1
- package/dist/lib/bridge-mode-browser.js +64 -3
- package/dist/lib/bridge-mode-browser.js.map +1 -1
- package/dist/lib/bridge-mode.js +20 -15
- package/dist/lib/bridge-mode.js.map +1 -1
- package/dist/lib/chrome-extension.js +80 -14
- package/dist/lib/chrome-extension.js.map +1 -1
- package/dist/lib/index.js +83 -13
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/midscene-playground.js +21 -13
- package/dist/lib/midscene-playground.js.map +1 -1
- package/dist/lib/playground.js +21 -13
- package/dist/lib/playground.js.map +1 -1
- package/dist/lib/playwright.js +81 -13
- package/dist/lib/playwright.js.map +1 -1
- package/dist/lib/puppeteer-agent-launcher.js +81 -13
- package/dist/lib/puppeteer-agent-launcher.js.map +1 -1
- package/dist/lib/puppeteer.js +81 -13
- package/dist/lib/puppeteer.js.map +1 -1
- package/dist/types/agent.d.ts +1 -1
- package/dist/types/bridge-mode-browser.d.ts +2 -2
- package/dist/types/bridge-mode.d.ts +2 -2
- package/dist/types/{browser-b6c0c1b4.d.ts → browser-d2ef61a6.d.ts} +1 -1
- package/dist/types/chrome-extension.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/midscene-server.d.ts +1 -1
- package/dist/types/{page-4ead209e.d.ts → page-c6a6ea51.d.ts} +8 -3
- package/dist/types/playground.d.ts +1 -1
- package/dist/types/playwright.d.ts +1 -1
- package/dist/types/puppeteer-agent-launcher.d.ts +1 -1
- package/dist/types/puppeteer.d.ts +2 -2
- package/dist/types/{utils-e5fce40f.d.ts → utils-d8dbe329.d.ts} +1 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types/yaml.d.ts +2 -2
- package/package.json +3 -3
package/dist/es/agent.js
CHANGED
|
@@ -585,7 +585,7 @@ import yaml3 from "js-yaml";
|
|
|
585
585
|
import semver from "semver";
|
|
586
586
|
|
|
587
587
|
// package.json
|
|
588
|
-
var version = "0.26.2
|
|
588
|
+
var version = "0.26.2";
|
|
589
589
|
|
|
590
590
|
// src/common/task-cache.ts
|
|
591
591
|
var DEFAULT_CACHE_MAX_FILENAME_LENGTH = 200;
|
|
@@ -1393,17 +1393,6 @@ var PageTaskExecutor = class {
|
|
|
1393
1393
|
}
|
|
1394
1394
|
};
|
|
1395
1395
|
tasks.push(taskActionError);
|
|
1396
|
-
} else if (plan2.type === "ExpectedFalsyCondition") {
|
|
1397
|
-
const taskActionFalsyConditionStatement = {
|
|
1398
|
-
type: "Action",
|
|
1399
|
-
subType: "ExpectedFalsyCondition",
|
|
1400
|
-
param: null,
|
|
1401
|
-
thought: plan2.param?.reason,
|
|
1402
|
-
locate: plan2.locate,
|
|
1403
|
-
executor: async () => {
|
|
1404
|
-
}
|
|
1405
|
-
};
|
|
1406
|
-
tasks.push(taskActionFalsyConditionStatement);
|
|
1407
1396
|
} else if (plan2.type === "Finished") {
|
|
1408
1397
|
const taskActionFinished = {
|
|
1409
1398
|
type: "Action",
|
|
@@ -1586,11 +1575,27 @@ var PageTaskExecutor = class {
|
|
|
1586
1575
|
executor: async (param, executorContext) => {
|
|
1587
1576
|
const startTime = Date.now();
|
|
1588
1577
|
const { pageContext } = await this.setupPlanningContext(executorContext);
|
|
1578
|
+
assert5(
|
|
1579
|
+
this.page.actionSpace,
|
|
1580
|
+
"actionSpace for device is not implemented"
|
|
1581
|
+
);
|
|
1582
|
+
const actionSpace = await this.page.actionSpace();
|
|
1583
|
+
debug3(
|
|
1584
|
+
"actionSpace for page",
|
|
1585
|
+
actionSpace.map((action) => action.name).join(", ")
|
|
1586
|
+
);
|
|
1587
|
+
assert5(Array.isArray(actionSpace), "actionSpace must be an array");
|
|
1588
|
+
if (actionSpace.length === 0) {
|
|
1589
|
+
console.warn(
|
|
1590
|
+
`ActionSpace for ${this.page.pageType} is empty. This may lead to unexpected behavior.`
|
|
1591
|
+
);
|
|
1592
|
+
}
|
|
1589
1593
|
const planResult = await plan(param.userInstruction, {
|
|
1590
1594
|
context: pageContext,
|
|
1591
1595
|
log: param.log,
|
|
1592
1596
|
actionContext,
|
|
1593
|
-
pageType: this.page.pageType
|
|
1597
|
+
pageType: this.page.pageType,
|
|
1598
|
+
actionSpace
|
|
1594
1599
|
});
|
|
1595
1600
|
const {
|
|
1596
1601
|
actions,
|