@midscene/web 0.16.2-beta-20250428050045.0 → 0.16.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 +3 -53
- package/dist/es/agent.js.map +1 -1
- package/dist/es/bridge-mode-browser.js +3 -3
- package/dist/es/bridge-mode-browser.js.map +1 -1
- package/dist/es/bridge-mode.js +5 -55
- package/dist/es/bridge-mode.js.map +1 -1
- package/dist/es/chrome-extension.js +4 -54
- package/dist/es/chrome-extension.js.map +1 -1
- package/dist/es/index.js +3 -53
- package/dist/es/index.js.map +1 -1
- package/dist/es/midscene-playground.js +3 -53
- package/dist/es/midscene-playground.js.map +1 -1
- package/dist/es/playground.js +3 -53
- package/dist/es/playground.js.map +1 -1
- package/dist/es/playwright.js +3 -53
- package/dist/es/playwright.js.map +1 -1
- package/dist/es/puppeteer-agent-launcher.js +3 -53
- package/dist/es/puppeteer-agent-launcher.js.map +1 -1
- package/dist/es/puppeteer.js +3 -53
- package/dist/es/puppeteer.js.map +1 -1
- package/dist/es/ui-utils.js.map +1 -1
- package/dist/lib/agent.js +3 -53
- package/dist/lib/agent.js.map +1 -1
- package/dist/lib/bridge-mode-browser.js +3 -3
- package/dist/lib/bridge-mode-browser.js.map +1 -1
- package/dist/lib/bridge-mode.js +5 -55
- package/dist/lib/bridge-mode.js.map +1 -1
- package/dist/lib/chrome-extension.js +4 -54
- package/dist/lib/chrome-extension.js.map +1 -1
- package/dist/lib/index.js +3 -53
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/midscene-playground.js +3 -53
- package/dist/lib/midscene-playground.js.map +1 -1
- package/dist/lib/playground.js +3 -53
- package/dist/lib/playground.js.map +1 -1
- package/dist/lib/playwright.js +3 -53
- package/dist/lib/playwright.js.map +1 -1
- package/dist/lib/puppeteer-agent-launcher.js +3 -53
- package/dist/lib/puppeteer-agent-launcher.js.map +1 -1
- package/dist/lib/puppeteer.js +3 -53
- package/dist/lib/puppeteer.js.map +1 -1
- package/dist/lib/ui-utils.js.map +1 -1
- package/dist/types/agent.d.ts +0 -8
- package/dist/types/ui-utils.d.ts +1 -1
- package/package.json +3 -3
package/dist/es/agent.js
CHANGED
|
@@ -1485,14 +1485,14 @@ var PageTaskExecutor = class {
|
|
|
1485
1485
|
executor: taskExecutor
|
|
1486
1486
|
};
|
|
1487
1487
|
}
|
|
1488
|
-
async
|
|
1488
|
+
async query(demand) {
|
|
1489
1489
|
const description = typeof demand === "string" ? demand : JSON.stringify(demand);
|
|
1490
|
-
const taskExecutor = new Executor(taskTitleStr(
|
|
1490
|
+
const taskExecutor = new Executor(taskTitleStr("Query", description), {
|
|
1491
1491
|
onTaskStart: this.onTaskStartCallback
|
|
1492
1492
|
});
|
|
1493
1493
|
const queryTask = {
|
|
1494
1494
|
type: "Insight",
|
|
1495
|
-
subType:
|
|
1495
|
+
subType: "Query",
|
|
1496
1496
|
locate: null,
|
|
1497
1497
|
param: {
|
|
1498
1498
|
dataDemand: demand
|
|
@@ -1520,21 +1520,6 @@ var PageTaskExecutor = class {
|
|
|
1520
1520
|
executor: taskExecutor
|
|
1521
1521
|
};
|
|
1522
1522
|
}
|
|
1523
|
-
async query(demand) {
|
|
1524
|
-
return this.createTypeQueryTask("Query", demand);
|
|
1525
|
-
}
|
|
1526
|
-
async boolean(prompt) {
|
|
1527
|
-
const demand = `${prompt}, boolean`;
|
|
1528
|
-
return this.createTypeQueryTask("Boolean", demand);
|
|
1529
|
-
}
|
|
1530
|
-
async number(prompt) {
|
|
1531
|
-
const demand = `${prompt}, number`;
|
|
1532
|
-
return this.createTypeQueryTask("Number", demand);
|
|
1533
|
-
}
|
|
1534
|
-
async string(prompt) {
|
|
1535
|
-
const demand = `${prompt}, string`;
|
|
1536
|
-
return this.createTypeQueryTask("String", demand);
|
|
1537
|
-
}
|
|
1538
1523
|
async assert(assertion) {
|
|
1539
1524
|
const description = `assert: ${assertion}`;
|
|
1540
1525
|
const taskExecutor = new Executor(taskTitleStr("Assert", description), {
|
|
@@ -1721,16 +1706,6 @@ function buildPlans(type, locateParam, param) {
|
|
|
1721
1706
|
};
|
|
1722
1707
|
returnPlans = [sleepPlan];
|
|
1723
1708
|
}
|
|
1724
|
-
if (type === "Locate") {
|
|
1725
|
-
assert5(locateParam, `missing locate info for action "${type}"`);
|
|
1726
|
-
const locatePlan2 = {
|
|
1727
|
-
type,
|
|
1728
|
-
param: locateParam,
|
|
1729
|
-
locate: locateParam,
|
|
1730
|
-
thought: ""
|
|
1731
|
-
};
|
|
1732
|
-
returnPlans = [locatePlan2];
|
|
1733
|
-
}
|
|
1734
1709
|
if (returnPlans) {
|
|
1735
1710
|
debug3("buildPlans", returnPlans);
|
|
1736
1711
|
return returnPlans;
|
|
@@ -1930,31 +1905,6 @@ ${errorTask?.errorStack}`);
|
|
|
1930
1905
|
this.afterTaskRunning(executor);
|
|
1931
1906
|
return output;
|
|
1932
1907
|
}
|
|
1933
|
-
async aiBoolean(prompt) {
|
|
1934
|
-
const { output, executor } = await this.taskExecutor.boolean(prompt);
|
|
1935
|
-
this.afterTaskRunning(executor);
|
|
1936
|
-
return output;
|
|
1937
|
-
}
|
|
1938
|
-
async aiNumber(prompt) {
|
|
1939
|
-
const { output, executor } = await this.taskExecutor.number(prompt);
|
|
1940
|
-
this.afterTaskRunning(executor);
|
|
1941
|
-
return output;
|
|
1942
|
-
}
|
|
1943
|
-
async aiString(prompt) {
|
|
1944
|
-
const { output, executor } = await this.taskExecutor.string(prompt);
|
|
1945
|
-
this.afterTaskRunning(executor);
|
|
1946
|
-
return output;
|
|
1947
|
-
}
|
|
1948
|
-
async aiLocate(prompt, opt) {
|
|
1949
|
-
const detailedLocateParam = this.buildDetailedLocateParam(prompt, opt);
|
|
1950
|
-
const plans = buildPlans("Locate", detailedLocateParam);
|
|
1951
|
-
const { executor, output } = await this.taskExecutor.runPlans(
|
|
1952
|
-
taskTitleStr("Locate", locateParamStr(detailedLocateParam)),
|
|
1953
|
-
plans
|
|
1954
|
-
);
|
|
1955
|
-
this.afterTaskRunning(executor);
|
|
1956
|
-
return output;
|
|
1957
|
-
}
|
|
1958
1908
|
async aiAssert(assertion, msg, opt) {
|
|
1959
1909
|
const { output, executor } = await this.taskExecutor.assert(assertion);
|
|
1960
1910
|
this.afterTaskRunning(executor, true);
|