@midscene/web 0.27.5 → 0.27.6

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 (49) hide show
  1. package/bin/midscene-playground +1 -1
  2. package/dist/es/bin.mjs +7 -0
  3. package/dist/es/bin.mjs.map +1 -0
  4. package/dist/es/bridge-mode/io-client.mjs +1 -1
  5. package/dist/es/bridge-mode/io-server.mjs +2 -2
  6. package/dist/es/bridge-mode/page-browser-side.mjs +1 -1
  7. package/dist/es/index.mjs +2 -3
  8. package/dist/es/web-element.mjs +3 -3
  9. package/dist/es/web-element.mjs.map +1 -1
  10. package/dist/lib/bin.js +13 -0
  11. package/dist/lib/bin.js.map +1 -0
  12. package/dist/lib/bridge-mode/io-client.js +1 -1
  13. package/dist/lib/bridge-mode/io-server.js +2 -2
  14. package/dist/lib/bridge-mode/page-browser-side.js +1 -1
  15. package/dist/lib/index.js +6 -16
  16. package/dist/lib/web-element.js +5 -5
  17. package/dist/lib/web-element.js.map +1 -1
  18. package/dist/types/index.d.ts +2 -3
  19. package/dist/types/web-element.d.ts +3 -11
  20. package/package.json +7 -25
  21. package/dist/es/playground/agent.mjs +0 -10
  22. package/dist/es/playground/agent.mjs.map +0 -1
  23. package/dist/es/playground/bin.mjs +0 -8
  24. package/dist/es/playground/bin.mjs.map +0 -1
  25. package/dist/es/playground/common.mjs +0 -130
  26. package/dist/es/playground/common.mjs.map +0 -1
  27. package/dist/es/playground/index.mjs +0 -5
  28. package/dist/es/playground/server.mjs +0 -256
  29. package/dist/es/playground/server.mjs.map +0 -1
  30. package/dist/es/playground/static-page.mjs +0 -104
  31. package/dist/es/playground/static-page.mjs.map +0 -1
  32. package/dist/lib/playground/agent.js +0 -44
  33. package/dist/lib/playground/agent.js.map +0 -1
  34. package/dist/lib/playground/bin.js +0 -36
  35. package/dist/lib/playground/bin.js.map +0 -1
  36. package/dist/lib/playground/common.js +0 -179
  37. package/dist/lib/playground/common.js.map +0 -1
  38. package/dist/lib/playground/index.js +0 -66
  39. package/dist/lib/playground/index.js.map +0 -1
  40. package/dist/lib/playground/server.js +0 -302
  41. package/dist/lib/playground/server.js.map +0 -1
  42. package/dist/lib/playground/static-page.js +0 -138
  43. package/dist/lib/playground/static-page.js.map +0 -1
  44. package/dist/types/playground/agent.d.ts +0 -5
  45. package/dist/types/playground/common.d.ts +0 -10
  46. package/dist/types/playground/index.d.ts +0 -5
  47. package/dist/types/playground/server.d.ts +0 -20
  48. package/dist/types/playground/static-page.d.ts +0 -39
  49. /package/dist/types/{playground/bin.d.ts → bin.d.ts} +0 -0
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require('../dist/lib/playground/bin.js');
3
+ require('../dist/lib/bin.js');
@@ -0,0 +1,7 @@
1
+ import { PlaygroundServer, StaticPage, StaticPageAgent } from "@midscene/playground";
2
+ const server = new PlaygroundServer(StaticPage, StaticPageAgent);
3
+ Promise.resolve().then(()=>server.launch()).then(()=>{
4
+ console.log(`Midscene playground server is running on http://localhost:${server.port}`);
5
+ });
6
+
7
+ //# sourceMappingURL=bin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.mjs","sources":["webpack://@midscene/web/./src/bin.ts"],"sourcesContent":["import {\n PlaygroundServer,\n StaticPage,\n StaticPageAgent,\n} from '@midscene/playground';\n\nconst server = new PlaygroundServer(StaticPage, StaticPageAgent);\nPromise.resolve()\n .then(() => server.launch())\n .then(() => {\n console.log(\n `Midscene playground server is running on http://localhost:${server.port}`,\n );\n });\n"],"names":["server","PlaygroundServer","StaticPage","StaticPageAgent","Promise","console"],"mappings":";AAMA,MAAMA,SAAS,IAAIC,iBAAiBC,YAAYC;AAChDC,QAAQ,OAAO,GACZ,IAAI,CAAC,IAAMJ,OAAO,MAAM,IACxB,IAAI,CAAC;IACJK,QAAQ,GAAG,CACT,CAAC,0DAA0D,EAAEL,OAAO,IAAI,EAAE;AAE9E"}
@@ -17,7 +17,7 @@ class BridgeClient {
17
17
  this.socket = io(this.endpoint, {
18
18
  reconnection: false,
19
19
  query: {
20
- version: "0.27.5"
20
+ version: "0.27.6"
21
21
  }
22
22
  });
23
23
  const timeout = setTimeout(()=>{
@@ -71,7 +71,7 @@ class BridgeServer {
71
71
  logMsg('one client connected');
72
72
  this.socket = socket;
73
73
  const clientVersion = socket.handshake.query.version;
74
- logMsg(`Bridge connected, cli-side version v0.27.5, browser-side version v${clientVersion}`);
74
+ logMsg(`Bridge connected, cli-side version v0.27.6, browser-side version v${clientVersion}`);
75
75
  socket.on(BridgeEvent.CallResponse, (params)=>{
76
76
  const id = params.id;
77
77
  const response = params.response;
@@ -99,7 +99,7 @@ class BridgeServer {
99
99
  var _this_onConnect, _this;
100
100
  null == (_this_onConnect = (_this = this).onConnect) || _this_onConnect.call(_this);
101
101
  const payload = {
102
- version: "0.27.5"
102
+ version: "0.27.6"
103
103
  };
104
104
  socket.emit(BridgeEvent.Connected, payload);
105
105
  Promise.resolve().then(()=>{
@@ -45,7 +45,7 @@ class ExtensionBridgePageBrowserSide extends page {
45
45
  }
46
46
  }, ()=>this.destroy());
47
47
  await this.bridgeClient.connect();
48
- this.onLogMessage(`Bridge connected, cli-side version v${this.bridgeClient.serverVersion}, browser-side version v0.27.5`, 'log');
48
+ this.onLogMessage(`Bridge connected, cli-side version v${this.bridgeClient.serverVersion}, browser-side version v0.27.6`, 'log');
49
49
  }
50
50
  async connect() {
51
51
  return await this.setupBridgeClient();
package/dist/es/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import { PlaywrightAgent, PlaywrightAiFixture } from "./playwright/index.mjs";
2
2
  import { Agent } from "@midscene/core/agent";
3
3
  import { PuppeteerAgent } from "./puppeteer/index.mjs";
4
- import { StaticPageAgent } from "./playground/agent.mjs";
4
+ import { StaticPageAgent } from "@midscene/playground";
5
5
  import { WebPageContextParser } from "./web-element.mjs";
6
- import { executeAction, formatErrorMessage, validateStructuredParams } from "./playground/common.mjs";
7
- export { Agent as PageAgent, PlaywrightAgent, PlaywrightAiFixture, PuppeteerAgent, StaticPageAgent, WebPageContextParser, executeAction, formatErrorMessage, validateStructuredParams };
6
+ export { Agent as PageAgent, PlaywrightAgent, PlaywrightAiFixture, PuppeteerAgent, StaticPageAgent, WebPageContextParser };
@@ -11,7 +11,7 @@ function _define_property(obj, key, value) {
11
11
  else obj[key] = value;
12
12
  return obj;
13
13
  }
14
- class WebElementInfo {
14
+ class WebElementInfoImpl {
15
15
  constructor({ content, rect, id, attributes, indexId, xpaths, isVisible }){
16
16
  _define_property(this, "content", void 0);
17
17
  _define_property(this, "rect", void 0);
@@ -41,7 +41,7 @@ async function WebPageContextParser(page, _opt) {
41
41
  const tree = await page.getElementsNodeTree();
42
42
  const webTree = traverseTree(tree, (elementInfo)=>{
43
43
  const { rect, id, content, attributes, indexId, isVisible } = elementInfo;
44
- return new WebElementInfo({
44
+ return new WebElementInfoImpl({
45
45
  rect,
46
46
  id,
47
47
  content,
@@ -79,6 +79,6 @@ if (!window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__) {
79
79
  }, true);
80
80
  }
81
81
  `;
82
- export { WebElementInfo, WebPageContextParser, limitOpenNewTabScript };
82
+ export { WebElementInfoImpl, WebPageContextParser, limitOpenNewTabScript };
83
83
 
84
84
  //# sourceMappingURL=web-element.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-element.mjs","sources":["webpack://@midscene/web/./src/web-element.ts"],"sourcesContent":["import type { AgentOpt, BaseElement, Rect, UIContext } from '@midscene/core';\nimport type { AbstractInterface } from '@midscene/core/device';\nimport type { NodeType } from '@midscene/shared/constants';\nimport { traverseTree } from '@midscene/shared/extractor';\nimport { getDebug } from '@midscene/shared/logger';\nimport { _keyDefinitions } from '@midscene/shared/us-keyboard-layout';\n\nimport { commonContextParser } from '@midscene/core/agent';\nimport type ChromeExtensionProxyPage from './chrome-extension/page';\nimport type { StaticPage } from './playground';\nimport type { PlaywrightWebPage } from './playwright';\nimport type { PuppeteerWebPage } from './puppeteer';\n\nexport type WebPageAgentOpt = AgentOpt & WebPageOpt;\nexport type WebPageOpt = {\n waitForNavigationTimeout?: number;\n waitForNetworkIdleTimeout?: number;\n forceSameTabNavigation?: boolean /* if limit the new tab to the current page, default true */;\n};\n\nexport type WebPage =\n | PlaywrightWebPage\n | PuppeteerWebPage\n | StaticPage\n | ChromeExtensionProxyPage;\n\nexport interface WebElementInfoType extends BaseElement {\n id: string;\n attributes: {\n nodeType: NodeType;\n [key: string]: string;\n };\n}\n\nexport class WebElementInfo implements BaseElement {\n content: string;\n\n rect: Rect;\n\n center: [number, number];\n\n id: string;\n\n indexId: number;\n\n attributes: {\n nodeType: NodeType;\n [key: string]: string;\n };\n\n xpaths?: string[];\n\n isVisible: boolean;\n\n constructor({\n content,\n rect,\n id,\n attributes,\n indexId,\n xpaths,\n isVisible,\n }: {\n content: string;\n rect: Rect;\n id: string;\n attributes: {\n nodeType: NodeType;\n [key: string]: string;\n };\n indexId: number;\n xpaths?: string[];\n isVisible: boolean;\n }) {\n this.content = content;\n this.rect = rect;\n this.center = [\n Math.floor(rect.left + rect.width / 2),\n Math.floor(rect.top + rect.height / 2),\n ];\n this.id = id;\n this.attributes = attributes;\n this.indexId = indexId;\n this.xpaths = xpaths;\n this.isVisible = isVisible;\n }\n}\n\nexport type WebUIContext = UIContext<WebElementInfo>;\n\nconst debug = getDebug('web:parse-context');\nexport async function WebPageContextParser(\n page: AbstractInterface,\n _opt?: any, // unused\n): Promise<UIContext> {\n const basicContext = await commonContextParser(page);\n\n debug('will traverse element tree');\n const tree = await page.getElementsNodeTree();\n const webTree = traverseTree(tree!, (elementInfo) => {\n const { rect, id, content, attributes, indexId, isVisible } = elementInfo;\n return new WebElementInfo({\n rect,\n id,\n content,\n attributes,\n indexId,\n isVisible,\n });\n });\n debug('traverse element tree end');\n\n return {\n ...basicContext,\n tree: webTree,\n };\n}\n\nexport const limitOpenNewTabScript = `\nif (!window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__) {\n window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__ = true;\n\n // Intercept the window.open method (only once)\n window.open = function(url) {\n console.log('Blocked window.open:', url);\n window.location.href = url;\n return null;\n };\n\n // Block all a tag clicks with target=\"_blank\" (only once)\n document.addEventListener('click', function(e) {\n const target = e.target.closest('a');\n if (target && target.target === '_blank') {\n e.preventDefault();\n console.log('Blocked new tab:', target.href);\n window.location.href = target.href;\n target.removeAttribute('target');\n }\n }, true);\n}\n`;\n"],"names":["WebElementInfo","content","rect","id","attributes","indexId","xpaths","isVisible","Math","debug","getDebug","WebPageContextParser","page","_opt","basicContext","commonContextParser","tree","webTree","traverseTree","elementInfo","limitOpenNewTabScript"],"mappings":";;;;;;;;;;;;;AAkCO,MAAMA;IAoBX,YAAY,EACVC,OAAO,EACPC,IAAI,EACJC,EAAE,EACFC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,SAAS,EAYV,CAAE;QAtCH;QAEA;QAEA;QAEA;QAEA;QAEA;QAKA;QAEA;QAsBE,IAAI,CAAC,OAAO,GAAGN;QACf,IAAI,CAAC,IAAI,GAAGC;QACZ,IAAI,CAAC,MAAM,GAAG;YACZM,KAAK,KAAK,CAACN,KAAK,IAAI,GAAGA,KAAK,KAAK,GAAG;YACpCM,KAAK,KAAK,CAACN,KAAK,GAAG,GAAGA,KAAK,MAAM,GAAG;SACrC;QACD,IAAI,CAAC,EAAE,GAAGC;QACV,IAAI,CAAC,UAAU,GAAGC;QAClB,IAAI,CAAC,OAAO,GAAGC;QACf,IAAI,CAAC,MAAM,GAAGC;QACd,IAAI,CAAC,SAAS,GAAGC;IACnB;AACF;AAIA,MAAME,QAAQC,SAAS;AAChB,eAAeC,qBACpBC,IAAuB,EACvBC,IAAU;IAEV,MAAMC,eAAe,MAAMC,oBAAoBH;IAE/CH,MAAM;IACN,MAAMO,OAAO,MAAMJ,KAAK,mBAAmB;IAC3C,MAAMK,UAAUC,aAAaF,MAAO,CAACG;QACnC,MAAM,EAAEjB,IAAI,EAAEC,EAAE,EAAEF,OAAO,EAAEG,UAAU,EAAEC,OAAO,EAAEE,SAAS,EAAE,GAAGY;QAC9D,OAAO,IAAInB,eAAe;YACxBE;YACAC;YACAF;YACAG;YACAC;YACAE;QACF;IACF;IACAE,MAAM;IAEN,OAAO;QACL,GAAGK,YAAY;QACf,MAAMG;IACR;AACF;AAEO,MAAMG,wBAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;AAsBtC,CAAC"}
1
+ {"version":3,"file":"web-element.mjs","sources":["webpack://@midscene/web/./src/web-element.ts"],"sourcesContent":["import type { AgentOpt, Rect, UIContext, WebElementInfo } from '@midscene/core';\nimport type { AbstractInterface } from '@midscene/core/device';\nimport { traverseTree } from '@midscene/shared/extractor';\nimport { getDebug } from '@midscene/shared/logger';\nimport { _keyDefinitions } from '@midscene/shared/us-keyboard-layout';\n\nimport { commonContextParser } from '@midscene/core/agent';\nimport type { StaticPage } from '@midscene/playground';\nimport type { NodeType } from '@midscene/shared/constants';\nimport type ChromeExtensionProxyPage from './chrome-extension/page';\nimport type { PlaywrightWebPage } from './playwright';\nimport type { PuppeteerWebPage } from './puppeteer';\n\nexport type WebPageAgentOpt = AgentOpt & WebPageOpt;\nexport type WebPageOpt = {\n waitForNavigationTimeout?: number;\n waitForNetworkIdleTimeout?: number;\n forceSameTabNavigation?: boolean /* if limit the new tab to the current page, default true */;\n};\n\nexport type WebPage =\n | PlaywrightWebPage\n | PuppeteerWebPage\n | StaticPage\n | ChromeExtensionProxyPage;\n\nexport class WebElementInfoImpl implements WebElementInfo {\n content: string;\n\n rect: Rect;\n\n center: [number, number];\n\n id: string;\n\n indexId: number;\n\n attributes: {\n nodeType: NodeType;\n [key: string]: string;\n };\n\n xpaths?: string[];\n\n isVisible: boolean;\n\n constructor({\n content,\n rect,\n id,\n attributes,\n indexId,\n xpaths,\n isVisible,\n }: {\n content: string;\n rect: Rect;\n id: string;\n attributes: {\n nodeType: NodeType;\n [key: string]: string;\n };\n indexId: number;\n xpaths?: string[];\n isVisible: boolean;\n }) {\n this.content = content;\n this.rect = rect;\n this.center = [\n Math.floor(rect.left + rect.width / 2),\n Math.floor(rect.top + rect.height / 2),\n ];\n this.id = id;\n this.attributes = attributes;\n this.indexId = indexId;\n this.xpaths = xpaths;\n this.isVisible = isVisible;\n }\n}\n\nconst debug = getDebug('web:parse-context');\nexport async function WebPageContextParser(\n page: AbstractInterface,\n _opt?: any, // unused\n): Promise<UIContext> {\n const basicContext = await commonContextParser(page);\n\n debug('will traverse element tree');\n const tree = await page.getElementsNodeTree();\n const webTree = traverseTree(tree!, (elementInfo) => {\n const { rect, id, content, attributes, indexId, isVisible } = elementInfo;\n return new WebElementInfoImpl({\n rect,\n id,\n content,\n attributes,\n indexId,\n isVisible,\n });\n });\n debug('traverse element tree end');\n\n return {\n ...basicContext,\n tree: webTree,\n };\n}\n\nexport const limitOpenNewTabScript = `\nif (!window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__) {\n window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__ = true;\n\n // Intercept the window.open method (only once)\n window.open = function(url) {\n console.log('Blocked window.open:', url);\n window.location.href = url;\n return null;\n };\n\n // Block all a tag clicks with target=\"_blank\" (only once)\n document.addEventListener('click', function(e) {\n const target = e.target.closest('a');\n if (target && target.target === '_blank') {\n e.preventDefault();\n console.log('Blocked new tab:', target.href);\n window.location.href = target.href;\n target.removeAttribute('target');\n }\n }, true);\n}\n`;\n"],"names":["WebElementInfoImpl","content","rect","id","attributes","indexId","xpaths","isVisible","Math","debug","getDebug","WebPageContextParser","page","_opt","basicContext","commonContextParser","tree","webTree","traverseTree","elementInfo","limitOpenNewTabScript"],"mappings":";;;;;;;;;;;;;AA0BO,MAAMA;IAoBX,YAAY,EACVC,OAAO,EACPC,IAAI,EACJC,EAAE,EACFC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,SAAS,EAYV,CAAE;QAtCH;QAEA;QAEA;QAEA;QAEA;QAEA;QAKA;QAEA;QAsBE,IAAI,CAAC,OAAO,GAAGN;QACf,IAAI,CAAC,IAAI,GAAGC;QACZ,IAAI,CAAC,MAAM,GAAG;YACZM,KAAK,KAAK,CAACN,KAAK,IAAI,GAAGA,KAAK,KAAK,GAAG;YACpCM,KAAK,KAAK,CAACN,KAAK,GAAG,GAAGA,KAAK,MAAM,GAAG;SACrC;QACD,IAAI,CAAC,EAAE,GAAGC;QACV,IAAI,CAAC,UAAU,GAAGC;QAClB,IAAI,CAAC,OAAO,GAAGC;QACf,IAAI,CAAC,MAAM,GAAGC;QACd,IAAI,CAAC,SAAS,GAAGC;IACnB;AACF;AAEA,MAAME,QAAQC,SAAS;AAChB,eAAeC,qBACpBC,IAAuB,EACvBC,IAAU;IAEV,MAAMC,eAAe,MAAMC,oBAAoBH;IAE/CH,MAAM;IACN,MAAMO,OAAO,MAAMJ,KAAK,mBAAmB;IAC3C,MAAMK,UAAUC,aAAaF,MAAO,CAACG;QACnC,MAAM,EAAEjB,IAAI,EAAEC,EAAE,EAAEF,OAAO,EAAEG,UAAU,EAAEC,OAAO,EAAEE,SAAS,EAAE,GAAGY;QAC9D,OAAO,IAAInB,mBAAmB;YAC5BE;YACAC;YACAF;YACAG;YACAC;YACAE;QACF;IACF;IACAE,MAAM;IAEN,OAAO;QACL,GAAGK,YAAY;QACf,MAAMG;IACR;AACF;AAEO,MAAMG,wBAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;AAsBtC,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __webpack_exports__ = {};
3
+ const playground_namespaceObject = require("@midscene/playground");
4
+ const server = new playground_namespaceObject.PlaygroundServer(playground_namespaceObject.StaticPage, playground_namespaceObject.StaticPageAgent);
5
+ Promise.resolve().then(()=>server.launch()).then(()=>{
6
+ console.log(`Midscene playground server is running on http://localhost:${server.port}`);
7
+ });
8
+ for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
9
+ Object.defineProperty(exports, '__esModule', {
10
+ value: true
11
+ });
12
+
13
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sources":["webpack://@midscene/web/./src/bin.ts"],"sourcesContent":["import {\n PlaygroundServer,\n StaticPage,\n StaticPageAgent,\n} from '@midscene/playground';\n\nconst server = new PlaygroundServer(StaticPage, StaticPageAgent);\nPromise.resolve()\n .then(() => server.launch())\n .then(() => {\n console.log(\n `Midscene playground server is running on http://localhost:${server.port}`,\n );\n });\n"],"names":["server","PlaygroundServer","StaticPage","StaticPageAgent","Promise","console"],"mappings":";;;AAMA,MAAMA,SAAS,IAAIC,2BAAAA,gBAAgBA,CAACC,2BAAAA,UAAUA,EAAEC,2BAAAA,eAAeA;AAC/DC,QAAQ,OAAO,GACZ,IAAI,CAAC,IAAMJ,OAAO,MAAM,IACxB,IAAI,CAAC;IACJK,QAAQ,GAAG,CACT,CAAC,0DAA0D,EAAEL,OAAO,IAAI,EAAE;AAE9E"}
@@ -45,7 +45,7 @@ class BridgeClient {
45
45
  this.socket = (0, external_socket_io_client_namespaceObject.io)(this.endpoint, {
46
46
  reconnection: false,
47
47
  query: {
48
- version: "0.27.5"
48
+ version: "0.27.6"
49
49
  }
50
50
  });
51
51
  const timeout = setTimeout(()=>{
@@ -100,7 +100,7 @@ class BridgeServer {
100
100
  (0, shared_utils_namespaceObject.logMsg)('one client connected');
101
101
  this.socket = socket;
102
102
  const clientVersion = socket.handshake.query.version;
103
- (0, shared_utils_namespaceObject.logMsg)(`Bridge connected, cli-side version v0.27.5, browser-side version v${clientVersion}`);
103
+ (0, shared_utils_namespaceObject.logMsg)(`Bridge connected, cli-side version v0.27.6, browser-side version v${clientVersion}`);
104
104
  socket.on(external_common_js_namespaceObject.BridgeEvent.CallResponse, (params)=>{
105
105
  const id = params.id;
106
106
  const response = params.response;
@@ -128,7 +128,7 @@ class BridgeServer {
128
128
  var _this_onConnect, _this;
129
129
  null == (_this_onConnect = (_this = this).onConnect) || _this_onConnect.call(_this);
130
130
  const payload = {
131
- version: "0.27.5"
131
+ version: "0.27.6"
132
132
  };
133
133
  socket.emit(external_common_js_namespaceObject.BridgeEvent.Connected, payload);
134
134
  Promise.resolve().then(()=>{
@@ -83,7 +83,7 @@ class ExtensionBridgePageBrowserSide extends page_js_default() {
83
83
  }
84
84
  }, ()=>this.destroy());
85
85
  await this.bridgeClient.connect();
86
- this.onLogMessage(`Bridge connected, cli-side version v${this.bridgeClient.serverVersion}, browser-side version v0.27.5`, 'log');
86
+ this.onLogMessage(`Bridge connected, cli-side version v${this.bridgeClient.serverVersion}, browser-side version v0.27.6`, 'log');
87
87
  }
88
88
  async connect() {
89
89
  return await this.setupBridgeClient();
package/dist/lib/index.js CHANGED
@@ -24,41 +24,31 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
- formatErrorMessage: ()=>common_js_namespaceObject.formatErrorMessage,
27
+ PlaywrightAgent: ()=>index_js_namespaceObject.PlaywrightAgent,
28
28
  WebPageContextParser: ()=>external_web_element_js_namespaceObject.WebPageContextParser,
29
- StaticPageAgent: ()=>agent_js_namespaceObject.StaticPageAgent,
29
+ PageAgent: ()=>agent_namespaceObject.Agent,
30
+ StaticPageAgent: ()=>playground_namespaceObject.StaticPageAgent,
30
31
  PuppeteerAgent: ()=>external_puppeteer_index_js_namespaceObject.PuppeteerAgent,
31
- executeAction: ()=>common_js_namespaceObject.executeAction,
32
- PlaywrightAgent: ()=>index_js_namespaceObject.PlaywrightAgent,
33
- PlaywrightAiFixture: ()=>index_js_namespaceObject.PlaywrightAiFixture,
34
- validateStructuredParams: ()=>common_js_namespaceObject.validateStructuredParams,
35
- PageAgent: ()=>agent_namespaceObject.Agent
32
+ PlaywrightAiFixture: ()=>index_js_namespaceObject.PlaywrightAiFixture
36
33
  });
37
34
  const index_js_namespaceObject = require("./playwright/index.js");
38
35
  const agent_namespaceObject = require("@midscene/core/agent");
39
36
  const external_puppeteer_index_js_namespaceObject = require("./puppeteer/index.js");
40
- const agent_js_namespaceObject = require("./playground/agent.js");
37
+ const playground_namespaceObject = require("@midscene/playground");
41
38
  const external_web_element_js_namespaceObject = require("./web-element.js");
42
- const common_js_namespaceObject = require("./playground/common.js");
43
39
  exports.PageAgent = __webpack_exports__.PageAgent;
44
40
  exports.PlaywrightAgent = __webpack_exports__.PlaywrightAgent;
45
41
  exports.PlaywrightAiFixture = __webpack_exports__.PlaywrightAiFixture;
46
42
  exports.PuppeteerAgent = __webpack_exports__.PuppeteerAgent;
47
43
  exports.StaticPageAgent = __webpack_exports__.StaticPageAgent;
48
44
  exports.WebPageContextParser = __webpack_exports__.WebPageContextParser;
49
- exports.executeAction = __webpack_exports__.executeAction;
50
- exports.formatErrorMessage = __webpack_exports__.formatErrorMessage;
51
- exports.validateStructuredParams = __webpack_exports__.validateStructuredParams;
52
45
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
53
46
  "PageAgent",
54
47
  "PlaywrightAgent",
55
48
  "PlaywrightAiFixture",
56
49
  "PuppeteerAgent",
57
50
  "StaticPageAgent",
58
- "WebPageContextParser",
59
- "executeAction",
60
- "formatErrorMessage",
61
- "validateStructuredParams"
51
+ "WebPageContextParser"
62
52
  ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
63
53
  Object.defineProperty(exports, '__esModule', {
64
54
  value: true
@@ -24,7 +24,7 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
- WebElementInfo: ()=>WebElementInfo,
27
+ WebElementInfoImpl: ()=>WebElementInfoImpl,
28
28
  WebPageContextParser: ()=>WebPageContextParser,
29
29
  limitOpenNewTabScript: ()=>limitOpenNewTabScript
30
30
  });
@@ -41,7 +41,7 @@ function _define_property(obj, key, value) {
41
41
  else obj[key] = value;
42
42
  return obj;
43
43
  }
44
- class WebElementInfo {
44
+ class WebElementInfoImpl {
45
45
  constructor({ content, rect, id, attributes, indexId, xpaths, isVisible }){
46
46
  _define_property(this, "content", void 0);
47
47
  _define_property(this, "rect", void 0);
@@ -71,7 +71,7 @@ async function WebPageContextParser(page, _opt) {
71
71
  const tree = await page.getElementsNodeTree();
72
72
  const webTree = (0, extractor_namespaceObject.traverseTree)(tree, (elementInfo)=>{
73
73
  const { rect, id, content, attributes, indexId, isVisible } = elementInfo;
74
- return new WebElementInfo({
74
+ return new WebElementInfoImpl({
75
75
  rect,
76
76
  id,
77
77
  content,
@@ -109,11 +109,11 @@ if (!window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__) {
109
109
  }, true);
110
110
  }
111
111
  `;
112
- exports.WebElementInfo = __webpack_exports__.WebElementInfo;
112
+ exports.WebElementInfoImpl = __webpack_exports__.WebElementInfoImpl;
113
113
  exports.WebPageContextParser = __webpack_exports__.WebPageContextParser;
114
114
  exports.limitOpenNewTabScript = __webpack_exports__.limitOpenNewTabScript;
115
115
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
116
- "WebElementInfo",
116
+ "WebElementInfoImpl",
117
117
  "WebPageContextParser",
118
118
  "limitOpenNewTabScript"
119
119
  ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
@@ -1 +1 @@
1
- {"version":3,"file":"web-element.js","sources":["webpack://@midscene/web/webpack/runtime/define_property_getters","webpack://@midscene/web/webpack/runtime/has_own_property","webpack://@midscene/web/webpack/runtime/make_namespace_object","webpack://@midscene/web/./src/web-element.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { AgentOpt, BaseElement, Rect, UIContext } from '@midscene/core';\nimport type { AbstractInterface } from '@midscene/core/device';\nimport type { NodeType } from '@midscene/shared/constants';\nimport { traverseTree } from '@midscene/shared/extractor';\nimport { getDebug } from '@midscene/shared/logger';\nimport { _keyDefinitions } from '@midscene/shared/us-keyboard-layout';\n\nimport { commonContextParser } from '@midscene/core/agent';\nimport type ChromeExtensionProxyPage from './chrome-extension/page';\nimport type { StaticPage } from './playground';\nimport type { PlaywrightWebPage } from './playwright';\nimport type { PuppeteerWebPage } from './puppeteer';\n\nexport type WebPageAgentOpt = AgentOpt & WebPageOpt;\nexport type WebPageOpt = {\n waitForNavigationTimeout?: number;\n waitForNetworkIdleTimeout?: number;\n forceSameTabNavigation?: boolean /* if limit the new tab to the current page, default true */;\n};\n\nexport type WebPage =\n | PlaywrightWebPage\n | PuppeteerWebPage\n | StaticPage\n | ChromeExtensionProxyPage;\n\nexport interface WebElementInfoType extends BaseElement {\n id: string;\n attributes: {\n nodeType: NodeType;\n [key: string]: string;\n };\n}\n\nexport class WebElementInfo implements BaseElement {\n content: string;\n\n rect: Rect;\n\n center: [number, number];\n\n id: string;\n\n indexId: number;\n\n attributes: {\n nodeType: NodeType;\n [key: string]: string;\n };\n\n xpaths?: string[];\n\n isVisible: boolean;\n\n constructor({\n content,\n rect,\n id,\n attributes,\n indexId,\n xpaths,\n isVisible,\n }: {\n content: string;\n rect: Rect;\n id: string;\n attributes: {\n nodeType: NodeType;\n [key: string]: string;\n };\n indexId: number;\n xpaths?: string[];\n isVisible: boolean;\n }) {\n this.content = content;\n this.rect = rect;\n this.center = [\n Math.floor(rect.left + rect.width / 2),\n Math.floor(rect.top + rect.height / 2),\n ];\n this.id = id;\n this.attributes = attributes;\n this.indexId = indexId;\n this.xpaths = xpaths;\n this.isVisible = isVisible;\n }\n}\n\nexport type WebUIContext = UIContext<WebElementInfo>;\n\nconst debug = getDebug('web:parse-context');\nexport async function WebPageContextParser(\n page: AbstractInterface,\n _opt?: any, // unused\n): Promise<UIContext> {\n const basicContext = await commonContextParser(page);\n\n debug('will traverse element tree');\n const tree = await page.getElementsNodeTree();\n const webTree = traverseTree(tree!, (elementInfo) => {\n const { rect, id, content, attributes, indexId, isVisible } = elementInfo;\n return new WebElementInfo({\n rect,\n id,\n content,\n attributes,\n indexId,\n isVisible,\n });\n });\n debug('traverse element tree end');\n\n return {\n ...basicContext,\n tree: webTree,\n };\n}\n\nexport const limitOpenNewTabScript = `\nif (!window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__) {\n window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__ = true;\n\n // Intercept the window.open method (only once)\n window.open = function(url) {\n console.log('Blocked window.open:', url);\n window.location.href = url;\n return null;\n };\n\n // Block all a tag clicks with target=\"_blank\" (only once)\n document.addEventListener('click', function(e) {\n const target = e.target.closest('a');\n if (target && target.target === '_blank') {\n e.preventDefault();\n console.log('Blocked new tab:', target.href);\n window.location.href = target.href;\n target.removeAttribute('target');\n }\n }, true);\n}\n`;\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","WebElementInfo","content","rect","id","attributes","indexId","xpaths","isVisible","Math","debug","getDebug","WebPageContextParser","page","_opt","basicContext","commonContextParser","tree","webTree","traverseTree","elementInfo","limitOpenNewTabScript"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;;;;;AC4BO,MAAMI;IAoBX,YAAY,EACVC,OAAO,EACPC,IAAI,EACJC,EAAE,EACFC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,SAAS,EAYV,CAAE;QAtCH;QAEA;QAEA;QAEA;QAEA;QAEA;QAKA;QAEA;QAsBE,IAAI,CAAC,OAAO,GAAGN;QACf,IAAI,CAAC,IAAI,GAAGC;QACZ,IAAI,CAAC,MAAM,GAAG;YACZM,KAAK,KAAK,CAACN,KAAK,IAAI,GAAGA,KAAK,KAAK,GAAG;YACpCM,KAAK,KAAK,CAACN,KAAK,GAAG,GAAGA,KAAK,MAAM,GAAG;SACrC;QACD,IAAI,CAAC,EAAE,GAAGC;QACV,IAAI,CAAC,UAAU,GAAGC;QAClB,IAAI,CAAC,OAAO,GAAGC;QACf,IAAI,CAAC,MAAM,GAAGC;QACd,IAAI,CAAC,SAAS,GAAGC;IACnB;AACF;AAIA,MAAME,QAAQC,AAAAA,IAAAA,uBAAAA,QAAAA,AAAAA,EAAS;AAChB,eAAeC,qBACpBC,IAAuB,EACvBC,IAAU;IAEV,MAAMC,eAAe,MAAMC,AAAAA,IAAAA,sBAAAA,mBAAAA,AAAAA,EAAoBH;IAE/CH,MAAM;IACN,MAAMO,OAAO,MAAMJ,KAAK,mBAAmB;IAC3C,MAAMK,UAAUC,AAAAA,IAAAA,0BAAAA,YAAAA,AAAAA,EAAaF,MAAO,CAACG;QACnC,MAAM,EAAEjB,IAAI,EAAEC,EAAE,EAAEF,OAAO,EAAEG,UAAU,EAAEC,OAAO,EAAEE,SAAS,EAAE,GAAGY;QAC9D,OAAO,IAAInB,eAAe;YACxBE;YACAC;YACAF;YACAG;YACAC;YACAE;QACF;IACF;IACAE,MAAM;IAEN,OAAO;QACL,GAAGK,YAAY;QACf,MAAMG;IACR;AACF;AAEO,MAAMG,wBAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;AAsBtC,CAAC"}
1
+ {"version":3,"file":"web-element.js","sources":["webpack://@midscene/web/webpack/runtime/define_property_getters","webpack://@midscene/web/webpack/runtime/has_own_property","webpack://@midscene/web/webpack/runtime/make_namespace_object","webpack://@midscene/web/./src/web-element.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { AgentOpt, Rect, UIContext, WebElementInfo } from '@midscene/core';\nimport type { AbstractInterface } from '@midscene/core/device';\nimport { traverseTree } from '@midscene/shared/extractor';\nimport { getDebug } from '@midscene/shared/logger';\nimport { _keyDefinitions } from '@midscene/shared/us-keyboard-layout';\n\nimport { commonContextParser } from '@midscene/core/agent';\nimport type { StaticPage } from '@midscene/playground';\nimport type { NodeType } from '@midscene/shared/constants';\nimport type ChromeExtensionProxyPage from './chrome-extension/page';\nimport type { PlaywrightWebPage } from './playwright';\nimport type { PuppeteerWebPage } from './puppeteer';\n\nexport type WebPageAgentOpt = AgentOpt & WebPageOpt;\nexport type WebPageOpt = {\n waitForNavigationTimeout?: number;\n waitForNetworkIdleTimeout?: number;\n forceSameTabNavigation?: boolean /* if limit the new tab to the current page, default true */;\n};\n\nexport type WebPage =\n | PlaywrightWebPage\n | PuppeteerWebPage\n | StaticPage\n | ChromeExtensionProxyPage;\n\nexport class WebElementInfoImpl implements WebElementInfo {\n content: string;\n\n rect: Rect;\n\n center: [number, number];\n\n id: string;\n\n indexId: number;\n\n attributes: {\n nodeType: NodeType;\n [key: string]: string;\n };\n\n xpaths?: string[];\n\n isVisible: boolean;\n\n constructor({\n content,\n rect,\n id,\n attributes,\n indexId,\n xpaths,\n isVisible,\n }: {\n content: string;\n rect: Rect;\n id: string;\n attributes: {\n nodeType: NodeType;\n [key: string]: string;\n };\n indexId: number;\n xpaths?: string[];\n isVisible: boolean;\n }) {\n this.content = content;\n this.rect = rect;\n this.center = [\n Math.floor(rect.left + rect.width / 2),\n Math.floor(rect.top + rect.height / 2),\n ];\n this.id = id;\n this.attributes = attributes;\n this.indexId = indexId;\n this.xpaths = xpaths;\n this.isVisible = isVisible;\n }\n}\n\nconst debug = getDebug('web:parse-context');\nexport async function WebPageContextParser(\n page: AbstractInterface,\n _opt?: any, // unused\n): Promise<UIContext> {\n const basicContext = await commonContextParser(page);\n\n debug('will traverse element tree');\n const tree = await page.getElementsNodeTree();\n const webTree = traverseTree(tree!, (elementInfo) => {\n const { rect, id, content, attributes, indexId, isVisible } = elementInfo;\n return new WebElementInfoImpl({\n rect,\n id,\n content,\n attributes,\n indexId,\n isVisible,\n });\n });\n debug('traverse element tree end');\n\n return {\n ...basicContext,\n tree: webTree,\n };\n}\n\nexport const limitOpenNewTabScript = `\nif (!window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__) {\n window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__ = true;\n\n // Intercept the window.open method (only once)\n window.open = function(url) {\n console.log('Blocked window.open:', url);\n window.location.href = url;\n return null;\n };\n\n // Block all a tag clicks with target=\"_blank\" (only once)\n document.addEventListener('click', function(e) {\n const target = e.target.closest('a');\n if (target && target.target === '_blank') {\n e.preventDefault();\n console.log('Blocked new tab:', target.href);\n window.location.href = target.href;\n target.removeAttribute('target');\n }\n }, true);\n}\n`;\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","WebElementInfoImpl","content","rect","id","attributes","indexId","xpaths","isVisible","Math","debug","getDebug","WebPageContextParser","page","_opt","basicContext","commonContextParser","tree","webTree","traverseTree","elementInfo","limitOpenNewTabScript"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;;;;;ACoBO,MAAMI;IAoBX,YAAY,EACVC,OAAO,EACPC,IAAI,EACJC,EAAE,EACFC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,SAAS,EAYV,CAAE;QAtCH;QAEA;QAEA;QAEA;QAEA;QAEA;QAKA;QAEA;QAsBE,IAAI,CAAC,OAAO,GAAGN;QACf,IAAI,CAAC,IAAI,GAAGC;QACZ,IAAI,CAAC,MAAM,GAAG;YACZM,KAAK,KAAK,CAACN,KAAK,IAAI,GAAGA,KAAK,KAAK,GAAG;YACpCM,KAAK,KAAK,CAACN,KAAK,GAAG,GAAGA,KAAK,MAAM,GAAG;SACrC;QACD,IAAI,CAAC,EAAE,GAAGC;QACV,IAAI,CAAC,UAAU,GAAGC;QAClB,IAAI,CAAC,OAAO,GAAGC;QACf,IAAI,CAAC,MAAM,GAAGC;QACd,IAAI,CAAC,SAAS,GAAGC;IACnB;AACF;AAEA,MAAME,QAAQC,AAAAA,IAAAA,uBAAAA,QAAAA,AAAAA,EAAS;AAChB,eAAeC,qBACpBC,IAAuB,EACvBC,IAAU;IAEV,MAAMC,eAAe,MAAMC,AAAAA,IAAAA,sBAAAA,mBAAAA,AAAAA,EAAoBH;IAE/CH,MAAM;IACN,MAAMO,OAAO,MAAMJ,KAAK,mBAAmB;IAC3C,MAAMK,UAAUC,AAAAA,IAAAA,0BAAAA,YAAAA,AAAAA,EAAaF,MAAO,CAACG;QACnC,MAAM,EAAEjB,IAAI,EAAEC,EAAE,EAAEF,OAAO,EAAEG,UAAU,EAAEC,OAAO,EAAEE,SAAS,EAAE,GAAGY;QAC9D,OAAO,IAAInB,mBAAmB;YAC5BE;YACAC;YACAF;YACAG;YACAC;YACAE;QACF;IACF;IACAE,MAAM;IAEN,OAAO;QACL,GAAGK,YAAY;QACf,MAAMG;IACR;AACF;AAEO,MAAMG,wBAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;AAsBtC,CAAC"}
@@ -1,10 +1,9 @@
1
1
  export { PlaywrightAiFixture } from './playwright';
2
2
  export type { PlayWrightAiFixtureType } from './playwright';
3
3
  export type { WebPage } from './web-element';
4
- export type { WebUIContext } from './web-element';
4
+ export type { WebUIContext } from '@midscene/core';
5
5
  export { Agent as PageAgent, type AgentOpt } from '@midscene/core/agent';
6
6
  export { PuppeteerAgent } from './puppeteer';
7
7
  export { PlaywrightAgent } from './playwright';
8
- export { StaticPageAgent } from './playground/agent';
8
+ export { StaticPageAgent } from '@midscene/playground';
9
9
  export { WebPageContextParser } from './web-element';
10
- export { formatErrorMessage, executeAction, validateStructuredParams, } from './playground/common';
@@ -1,8 +1,8 @@
1
- import type { AgentOpt, BaseElement, Rect, UIContext } from '@midscene/core';
1
+ import type { AgentOpt, Rect, UIContext, WebElementInfo } from '@midscene/core';
2
2
  import type { AbstractInterface } from '@midscene/core/device';
3
+ import type { StaticPage } from '@midscene/playground';
3
4
  import type { NodeType } from '@midscene/shared/constants';
4
5
  import type ChromeExtensionProxyPage from './chrome-extension/page';
5
- import type { StaticPage } from './playground';
6
6
  import type { PlaywrightWebPage } from './playwright';
7
7
  import type { PuppeteerWebPage } from './puppeteer';
8
8
  export type WebPageAgentOpt = AgentOpt & WebPageOpt;
@@ -12,14 +12,7 @@ export type WebPageOpt = {
12
12
  forceSameTabNavigation?: boolean;
13
13
  };
14
14
  export type WebPage = PlaywrightWebPage | PuppeteerWebPage | StaticPage | ChromeExtensionProxyPage;
15
- export interface WebElementInfoType extends BaseElement {
16
- id: string;
17
- attributes: {
18
- nodeType: NodeType;
19
- [key: string]: string;
20
- };
21
- }
22
- export declare class WebElementInfo implements BaseElement {
15
+ export declare class WebElementInfoImpl implements WebElementInfo {
23
16
  content: string;
24
17
  rect: Rect;
25
18
  center: [number, number];
@@ -44,6 +37,5 @@ export declare class WebElementInfo implements BaseElement {
44
37
  isVisible: boolean;
45
38
  });
46
39
  }
47
- export type WebUIContext = UIContext<WebElementInfo>;
48
40
  export declare function WebPageContextParser(page: AbstractInterface, _opt?: any): Promise<UIContext>;
49
41
  export declare const limitOpenNewTabScript = "\nif (!window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__) {\n window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__ = true;\n\n // Intercept the window.open method (only once)\n window.open = function(url) {\n console.log('Blocked window.open:', url);\n window.location.href = url;\n return null;\n };\n\n // Block all a tag clicks with target=\"_blank\" (only once)\n document.addEventListener('click', function(e) {\n const target = e.target.closest('a');\n if (target && target.target === '_blank') {\n e.preventDefault();\n console.log('Blocked new tab:', target.href);\n window.location.href = target.href;\n target.removeAttribute('target');\n }\n }, true);\n}\n";
package/package.json CHANGED
@@ -8,15 +8,12 @@
8
8
  "Browser use",
9
9
  "Android use"
10
10
  ],
11
- "version": "0.27.5",
11
+ "version": "0.27.6",
12
12
  "repository": "https://github.com/web-infra-dev/midscene",
13
13
  "homepage": "https://midscenejs.com/",
14
14
  "main": "./dist/lib/index.js",
15
15
  "types": "./dist/types/index.d.ts",
16
16
  "module": "./dist/es/index.mjs",
17
- "bin": {
18
- "midscene-playground": "./bin/midscene-playground"
19
- },
20
17
  "exports": {
21
18
  ".": {
22
19
  "types": "./dist/types/index.d.ts",
@@ -68,21 +65,6 @@
68
65
  "require": "./dist/lib/playwright/reporter/index.js",
69
66
  "import": "./dist/es/playwright/reporter/index.mjs"
70
67
  },
71
- "./playground": {
72
- "types": "./dist/types/playground/index.d.ts",
73
- "require": "./dist/lib/playground/index.js",
74
- "import": "./dist/es/playground/index.mjs"
75
- },
76
- "./midscene-playground": {
77
- "types": "./dist/types/playground/bin.d.ts",
78
- "require": "./dist/lib/playground/bin.js",
79
- "import": "./dist/es/playground/bin.mjs"
80
- },
81
- "./midscene-server": {
82
- "types": "./dist/types/playground/server.d.ts",
83
- "require": "./dist/lib/playground/server.js",
84
- "import": "./dist/es/playground/server.mjs"
85
- },
86
68
  "./chrome-extension": {
87
69
  "types": "./dist/types/chrome-extension/index.d.ts",
88
70
  "require": "./dist/lib/chrome-extension/index.js",
@@ -108,6 +90,9 @@
108
90
  "quiet": false
109
91
  }
110
92
  },
93
+ "bin": {
94
+ "midscene-playground": "./bin/midscene-playground"
95
+ },
111
96
  "files": [
112
97
  "static",
113
98
  "dist",
@@ -116,23 +101,20 @@
116
101
  "bin"
117
102
  ],
118
103
  "dependencies": {
119
- "cors": "2.8.5",
120
104
  "dayjs": "^1.11.11",
121
105
  "dotenv": "16.4.5",
122
- "express": "^4.21.2",
123
106
  "http-server": "14.1.1",
124
107
  "socket.io": "^4.8.1",
125
108
  "socket.io-client": "4.8.1",
126
- "@midscene/core": "0.27.5",
127
- "@midscene/shared": "0.27.5"
109
+ "@midscene/core": "0.27.6",
110
+ "@midscene/shared": "0.27.6",
111
+ "@midscene/playground": "0.27.6"
128
112
  },
129
113
  "devDependencies": {
130
114
  "devtools-protocol": "0.0.1380148",
131
115
  "@playwright/test": "^1.44.1",
132
116
  "@rslib/core": "^0.11.2",
133
117
  "@types/chrome": "0.0.279",
134
- "@types/cors": "2.8.12",
135
- "@types/express": "^4.17.21",
136
118
  "@types/http-server": "^0.12.4",
137
119
  "@types/node": "^18.0.0",
138
120
  "playwright": "1.44.1",
@@ -1,10 +0,0 @@
1
- import { Agent } from "@midscene/core/agent";
2
- class StaticPageAgent extends Agent {
3
- constructor(page){
4
- super(page, {});
5
- this.dryMode = true;
6
- }
7
- }
8
- export { StaticPageAgent };
9
-
10
- //# sourceMappingURL=agent.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"playground/agent.mjs","sources":["webpack://@midscene/web/./src/playground/agent.ts"],"sourcesContent":["import { Agent as PageAgent } from '@midscene/core/agent';\nimport type StaticPage from './static-page';\n\nexport class StaticPageAgent extends PageAgent {\n constructor(page: StaticPage) {\n super(page, {});\n this.dryMode = true;\n }\n}\n"],"names":["StaticPageAgent","PageAgent","page"],"mappings":";AAGO,MAAMA,wBAAwBC;IACnC,YAAYC,IAAgB,CAAE;QAC5B,KAAK,CAACA,MAAM,CAAC;QACb,IAAI,CAAC,OAAO,GAAG;IACjB;AACF"}
@@ -1,8 +0,0 @@
1
- import { StaticPage, StaticPageAgent } from "./index.mjs";
2
- import server from "./server.mjs";
3
- const bin_server = new server(StaticPage, StaticPageAgent);
4
- Promise.resolve().then(()=>bin_server.launch()).then(()=>{
5
- console.log(`Midscene playground server is running on http://localhost:${bin_server.port}`);
6
- });
7
-
8
- //# sourceMappingURL=bin.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"playground/bin.mjs","sources":["webpack://@midscene/web/./src/playground/bin.ts"],"sourcesContent":["import { StaticPage, StaticPageAgent } from './';\nimport PlaygroundServer from './server';\n\nconst server = new PlaygroundServer(StaticPage, StaticPageAgent);\nPromise.resolve()\n .then(() => server.launch())\n .then(() => {\n console.log(\n `Midscene playground server is running on http://localhost:${server.port}`,\n );\n });\n"],"names":["server","PlaygroundServer","StaticPage","StaticPageAgent","Promise","console"],"mappings":";;AAGA,MAAMA,aAAS,IAAIC,OAAiBC,YAAYC;AAChDC,QAAQ,OAAO,GACZ,IAAI,CAAC,IAAMJ,WAAO,MAAM,IACxB,IAAI,CAAC;IACJK,QAAQ,GAAG,CACT,CAAC,0DAA0D,EAAEL,WAAO,IAAI,EAAE;AAE9E"}
@@ -1,130 +0,0 @@
1
- import { findAllMidsceneLocatorField } from "@midscene/core/ai-model";
2
- const dataExtractionAPIs = [
3
- 'aiQuery',
4
- 'aiBoolean',
5
- 'aiNumber',
6
- 'aiString',
7
- 'aiAsk'
8
- ];
9
- const validationAPIs = [
10
- 'aiAssert',
11
- 'aiWaitFor'
12
- ];
13
- const noReplayAPIs = [
14
- ...dataExtractionAPIs,
15
- ...validationAPIs
16
- ];
17
- const formatErrorMessage = (e)=>{
18
- const errorMessage = (null == e ? void 0 : e.message) || '';
19
- if (errorMessage.includes('of different extension')) return 'Conflicting extension detected. Please disable the suspicious plugins and refresh the page. Guide: https://midscenejs.com/quick-experience.html#faq';
20
- return errorMessage || 'Unknown error';
21
- };
22
- async function parseStructuredParams(action, params, options = {}) {
23
- if (!(null == action ? void 0 : action.paramSchema) || !('shape' in action.paramSchema)) return [
24
- params.prompt || '',
25
- options
26
- ];
27
- const schema = action.paramSchema;
28
- const keys = Object.keys(schema.shape);
29
- const paramObj = {
30
- ...options
31
- };
32
- keys.forEach((key)=>{
33
- if (void 0 !== params[key] && null !== params[key] && '' !== params[key]) paramObj[key] = params[key];
34
- });
35
- return [
36
- paramObj
37
- ];
38
- }
39
- function validateStructuredParams(value, action) {
40
- if (!value.params) return {
41
- valid: false,
42
- errorMessage: 'Parameters are required'
43
- };
44
- if (!(null == action ? void 0 : action.paramSchema)) return {
45
- valid: true
46
- };
47
- try {
48
- var _action_paramSchema;
49
- const paramsForValidation = {
50
- ...value.params
51
- };
52
- const schema = action.paramSchema;
53
- if (schema) {
54
- const locatorFieldKeys = findAllMidsceneLocatorField(schema);
55
- locatorFieldKeys.forEach((key)=>{
56
- if ('string' == typeof paramsForValidation[key]) paramsForValidation[key] = {
57
- midscene_location_field_flag: true,
58
- prompt: paramsForValidation[key],
59
- center: [
60
- 0,
61
- 0
62
- ],
63
- rect: {
64
- left: 0,
65
- top: 0,
66
- width: 0,
67
- height: 0
68
- }
69
- };
70
- });
71
- }
72
- null == (_action_paramSchema = action.paramSchema) || _action_paramSchema.parse(paramsForValidation);
73
- } catch (error) {
74
- const zodError = error;
75
- if (zodError.errors && zodError.errors.length > 0) {
76
- const errorMessages = zodError.errors.filter((err)=>{
77
- const path = err.path.join('.');
78
- return !path.includes('center') && !path.includes('rect') && !path.includes('midscene_location_field_flag');
79
- }).map((err)=>{
80
- const field = err.path.join('.');
81
- return `${field}: ${err.message}`;
82
- });
83
- if (errorMessages.length > 0) return {
84
- valid: false,
85
- errorMessage: `Validation error: ${errorMessages.join(', ')}`
86
- };
87
- } else {
88
- const errorMsg = error instanceof Error ? error.message : 'Unknown validation error';
89
- return {
90
- valid: false,
91
- errorMessage: `Parameter validation failed: ${errorMsg}`
92
- };
93
- }
94
- }
95
- return {
96
- valid: true
97
- };
98
- }
99
- async function executeAction(activeAgent, actionType, actionSpace, value, deepThink) {
100
- const action = null == actionSpace ? void 0 : actionSpace.find((a)=>a.interfaceAlias === actionType || a.name === actionType);
101
- if (action && 'function' == typeof activeAgent.callActionInActionSpace) if (!value.params) return await activeAgent.callActionInActionSpace(action.name, {
102
- prompt: value.prompt,
103
- deepThink
104
- });
105
- else {
106
- const parsedParams = await parseStructuredParams(action, value.params, {
107
- deepThink
108
- });
109
- return await activeAgent.callActionInActionSpace(action.name, parsedParams[0]);
110
- }
111
- {
112
- const prompt = value.prompt;
113
- if ('aiAssert' === actionType) {
114
- const { pass, thought } = await (null == activeAgent ? void 0 : activeAgent.aiAssert(prompt, void 0, {
115
- keepRawResponse: true
116
- })) || {};
117
- return {
118
- pass,
119
- thought
120
- };
121
- }
122
- if (activeAgent && 'function' == typeof activeAgent[actionType]) return await activeAgent[actionType](prompt, {
123
- deepThink
124
- });
125
- throw new Error(`Unknown action type: ${actionType}`);
126
- }
127
- }
128
- export { dataExtractionAPIs, executeAction, formatErrorMessage, noReplayAPIs, validateStructuredParams, validationAPIs };
129
-
130
- //# sourceMappingURL=common.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"playground/common.mjs","sources":["webpack://@midscene/web/./src/playground/common.ts"],"sourcesContent":["import type { DeviceAction } from '@midscene/core';\nimport { findAllMidsceneLocatorField } from '@midscene/core/ai-model';\n\n// APIs that should not generate replay scripts\nexport const dataExtractionAPIs = [\n 'aiQuery',\n 'aiBoolean',\n 'aiNumber',\n 'aiString',\n 'aiAsk',\n];\n\nexport const validationAPIs = ['aiAssert', 'aiWaitFor'];\n\nexport const noReplayAPIs = [...dataExtractionAPIs, ...validationAPIs];\n\nexport const formatErrorMessage = (e: any): string => {\n const errorMessage = e?.message || '';\n if (errorMessage.includes('of different extension')) {\n return 'Conflicting extension detected. Please disable the suspicious plugins and refresh the page. Guide: https://midscenejs.com/quick-experience.html#faq';\n }\n // Always return the actual error message, including NOT_IMPLEMENTED_AS_DESIGNED errors\n return errorMessage || 'Unknown error';\n};\n\n// Parse structured parameters for callActionInActionSpace\nasync function parseStructuredParams(\n action: DeviceAction<any>,\n params: Record<string, any>,\n options: { deepThink?: boolean } = {},\n): Promise<any[]> {\n if (!action?.paramSchema || !('shape' in action.paramSchema)) {\n return [params.prompt || '', options];\n }\n\n const schema = action.paramSchema as any;\n const keys = Object.keys(schema.shape);\n\n const paramObj: Record<string, unknown> = { ...options };\n\n keys.forEach((key) => {\n if (\n params[key] !== undefined &&\n params[key] !== null &&\n params[key] !== ''\n ) {\n paramObj[key] = params[key];\n }\n });\n\n return [paramObj];\n}\n\nexport function validateStructuredParams(\n value: any,\n action: DeviceAction<any> | undefined,\n): { valid: boolean; errorMessage?: string } {\n if (!value.params) {\n return { valid: false, errorMessage: 'Parameters are required' };\n }\n\n if (!action?.paramSchema) {\n return { valid: true };\n }\n\n try {\n const paramsForValidation = { ...value.params };\n\n const schema = action.paramSchema;\n if (schema) {\n const locatorFieldKeys = findAllMidsceneLocatorField(schema);\n locatorFieldKeys.forEach((key) => {\n if (typeof paramsForValidation[key] === 'string') {\n paramsForValidation[key] = {\n midscene_location_field_flag: true,\n prompt: paramsForValidation[key],\n center: [0, 0],\n rect: { left: 0, top: 0, width: 0, height: 0 },\n };\n }\n });\n }\n\n action.paramSchema?.parse(paramsForValidation);\n return { valid: true };\n } catch (error: unknown) {\n const zodError = error as {\n errors?: Array<{ path: string[]; message: string }>;\n };\n if (zodError.errors && zodError.errors.length > 0) {\n const errorMessages = zodError.errors\n .filter((err) => {\n const path = err.path.join('.');\n return (\n !path.includes('center') &&\n !path.includes('rect') &&\n !path.includes('midscene_location_field_flag')\n );\n })\n .map((err) => {\n const field = err.path.join('.');\n return `${field}: ${err.message}`;\n });\n\n if (errorMessages.length > 0) {\n return {\n valid: false,\n errorMessage: `Validation error: ${errorMessages.join(', ')}`,\n };\n }\n } else {\n const errorMsg =\n error instanceof Error ? error.message : 'Unknown validation error';\n return {\n valid: false,\n errorMessage: `Parameter validation failed: ${errorMsg}`,\n };\n }\n }\n\n return { valid: true };\n}\n\nexport async function executeAction(\n activeAgent: any,\n actionType: string,\n actionSpace: DeviceAction<any>[],\n value: any,\n deepThink: boolean,\n): Promise<any> {\n const action = actionSpace?.find(\n (a: DeviceAction<any>) =>\n a.interfaceAlias === actionType || a.name === actionType,\n );\n\n if (action && typeof activeAgent.callActionInActionSpace === 'function') {\n if (value.params) {\n const parsedParams = await parseStructuredParams(action, value.params, {\n deepThink,\n });\n return await activeAgent.callActionInActionSpace(\n action.name,\n parsedParams[0],\n );\n } else {\n return await activeAgent.callActionInActionSpace(action.name, {\n prompt: value.prompt,\n deepThink,\n });\n }\n } else {\n const prompt = value.prompt;\n\n if (actionType === 'aiAssert') {\n const { pass, thought } =\n (await activeAgent?.aiAssert(prompt, undefined, {\n keepRawResponse: true,\n })) || {};\n return { pass, thought };\n }\n\n // Fallback for methods not found in actionSpace\n if (activeAgent && typeof activeAgent[actionType] === 'function') {\n return await activeAgent[actionType](prompt, {\n deepThink,\n });\n }\n\n throw new Error(`Unknown action type: ${actionType}`);\n }\n}\n"],"names":["dataExtractionAPIs","validationAPIs","noReplayAPIs","formatErrorMessage","e","errorMessage","parseStructuredParams","action","params","options","schema","keys","Object","paramObj","key","undefined","validateStructuredParams","value","_action_paramSchema","paramsForValidation","locatorFieldKeys","findAllMidsceneLocatorField","error","zodError","errorMessages","err","path","field","errorMsg","Error","executeAction","activeAgent","actionType","actionSpace","deepThink","a","parsedParams","prompt","pass","thought"],"mappings":"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"}
@@ -1,5 +0,0 @@
1
- import { ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED } from "@midscene/shared/common";
2
- import { StaticPageAgent } from "./agent.mjs";
3
- import { dataExtractionAPIs, noReplayAPIs, validationAPIs } from "./common.mjs";
4
- import static_page from "./static-page.mjs";
5
- export { ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED, static_page as StaticPage, StaticPageAgent, dataExtractionAPIs, noReplayAPIs, validationAPIs };