@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.
Files changed (45) hide show
  1. package/dist/es/agent.js +3 -53
  2. package/dist/es/agent.js.map +1 -1
  3. package/dist/es/bridge-mode-browser.js +3 -3
  4. package/dist/es/bridge-mode-browser.js.map +1 -1
  5. package/dist/es/bridge-mode.js +5 -55
  6. package/dist/es/bridge-mode.js.map +1 -1
  7. package/dist/es/chrome-extension.js +4 -54
  8. package/dist/es/chrome-extension.js.map +1 -1
  9. package/dist/es/index.js +3 -53
  10. package/dist/es/index.js.map +1 -1
  11. package/dist/es/midscene-playground.js +3 -53
  12. package/dist/es/midscene-playground.js.map +1 -1
  13. package/dist/es/playground.js +3 -53
  14. package/dist/es/playground.js.map +1 -1
  15. package/dist/es/playwright.js +3 -53
  16. package/dist/es/playwright.js.map +1 -1
  17. package/dist/es/puppeteer-agent-launcher.js +3 -53
  18. package/dist/es/puppeteer-agent-launcher.js.map +1 -1
  19. package/dist/es/puppeteer.js +3 -53
  20. package/dist/es/puppeteer.js.map +1 -1
  21. package/dist/es/ui-utils.js.map +1 -1
  22. package/dist/lib/agent.js +3 -53
  23. package/dist/lib/agent.js.map +1 -1
  24. package/dist/lib/bridge-mode-browser.js +3 -3
  25. package/dist/lib/bridge-mode-browser.js.map +1 -1
  26. package/dist/lib/bridge-mode.js +5 -55
  27. package/dist/lib/bridge-mode.js.map +1 -1
  28. package/dist/lib/chrome-extension.js +4 -54
  29. package/dist/lib/chrome-extension.js.map +1 -1
  30. package/dist/lib/index.js +3 -53
  31. package/dist/lib/index.js.map +1 -1
  32. package/dist/lib/midscene-playground.js +3 -53
  33. package/dist/lib/midscene-playground.js.map +1 -1
  34. package/dist/lib/playground.js +3 -53
  35. package/dist/lib/playground.js.map +1 -1
  36. package/dist/lib/playwright.js +3 -53
  37. package/dist/lib/playwright.js.map +1 -1
  38. package/dist/lib/puppeteer-agent-launcher.js +3 -53
  39. package/dist/lib/puppeteer-agent-launcher.js.map +1 -1
  40. package/dist/lib/puppeteer.js +3 -53
  41. package/dist/lib/puppeteer.js.map +1 -1
  42. package/dist/lib/ui-utils.js.map +1 -1
  43. package/dist/types/agent.d.ts +0 -8
  44. package/dist/types/ui-utils.d.ts +1 -1
  45. 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 createTypeQueryTask(type, demand) {
1488
+ async query(demand) {
1489
1489
  const description = typeof demand === "string" ? demand : JSON.stringify(demand);
1490
- const taskExecutor = new Executor(taskTitleStr(type, description), {
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: type,
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);