misoai-web 1.0.2 → 1.0.4

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 (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +8 -8
  3. package/bin/midscene-playground +2 -2
  4. package/dist/es/agent.js +167 -44
  5. package/dist/es/agent.js.map +1 -1
  6. package/dist/es/bridge-mode-browser.js +64 -17
  7. package/dist/es/bridge-mode-browser.js.map +1 -1
  8. package/dist/es/bridge-mode.js +169 -46
  9. package/dist/es/bridge-mode.js.map +1 -1
  10. package/dist/es/chrome-extension.js +229 -59
  11. package/dist/es/chrome-extension.js.map +1 -1
  12. package/dist/es/index.js +183 -45
  13. package/dist/es/index.js.map +1 -1
  14. package/dist/es/midscene-playground.js +173 -44
  15. package/dist/es/midscene-playground.js.map +1 -1
  16. package/dist/es/midscene-server.js.map +1 -1
  17. package/dist/es/playground.js +173 -44
  18. package/dist/es/playground.js.map +1 -1
  19. package/dist/es/playwright-report.js.map +1 -1
  20. package/dist/es/playwright.js +183 -45
  21. package/dist/es/playwright.js.map +1 -1
  22. package/dist/es/puppeteer-agent-launcher.js +183 -45
  23. package/dist/es/puppeteer-agent-launcher.js.map +1 -1
  24. package/dist/es/puppeteer.js +183 -45
  25. package/dist/es/puppeteer.js.map +1 -1
  26. package/dist/es/ui-utils.js.map +1 -1
  27. package/dist/es/utils.js.map +1 -1
  28. package/dist/es/yaml.js +21 -3
  29. package/dist/es/yaml.js.map +1 -1
  30. package/dist/lib/agent.js +167 -44
  31. package/dist/lib/agent.js.map +1 -1
  32. package/dist/lib/bridge-mode-browser.js +64 -17
  33. package/dist/lib/bridge-mode-browser.js.map +1 -1
  34. package/dist/lib/bridge-mode.js +169 -46
  35. package/dist/lib/bridge-mode.js.map +1 -1
  36. package/dist/lib/chrome-extension.js +229 -59
  37. package/dist/lib/chrome-extension.js.map +1 -1
  38. package/dist/lib/index.js +181 -46
  39. package/dist/lib/index.js.map +1 -1
  40. package/dist/lib/midscene-playground.js +173 -44
  41. package/dist/lib/midscene-playground.js.map +1 -1
  42. package/dist/lib/midscene-server.js.map +1 -1
  43. package/dist/lib/playground.js +173 -44
  44. package/dist/lib/playground.js.map +1 -1
  45. package/dist/lib/playwright-report.js.map +1 -1
  46. package/dist/lib/playwright.js +181 -46
  47. package/dist/lib/playwright.js.map +1 -1
  48. package/dist/lib/puppeteer-agent-launcher.js +181 -46
  49. package/dist/lib/puppeteer-agent-launcher.js.map +1 -1
  50. package/dist/lib/puppeteer.js +181 -46
  51. package/dist/lib/puppeteer.js.map +1 -1
  52. package/dist/lib/ui-utils.js.map +1 -1
  53. package/dist/lib/utils.js.map +1 -1
  54. package/dist/lib/yaml.js +21 -3
  55. package/dist/lib/yaml.js.map +1 -1
  56. package/dist/types/agent.d.ts +16 -6
  57. package/dist/types/bridge-mode-browser.d.ts +2 -2
  58. package/dist/types/bridge-mode.d.ts +2 -2
  59. package/dist/types/{browser-d447695b.d.ts → browser-a1877d18.d.ts} +1 -1
  60. package/dist/types/chrome-extension.d.ts +2 -2
  61. package/dist/types/index.d.ts +1 -1
  62. package/dist/types/midscene-server.d.ts +1 -1
  63. package/dist/types/{page-b8ada1f3.d.ts → page-663ece08.d.ts} +41 -30
  64. package/dist/types/playground.d.ts +2 -2
  65. package/dist/types/playwright.d.ts +1 -1
  66. package/dist/types/puppeteer-agent-launcher.d.ts +1 -1
  67. package/dist/types/puppeteer.d.ts +1 -1
  68. package/dist/types/utils.d.ts +1 -1
  69. package/dist/types/yaml.d.ts +1 -1
  70. package/iife-script/htmlElement.js +99 -37
  71. package/iife-script/htmlElementDebug.js +92 -9
  72. package/package.json +23 -24
@@ -48,9 +48,9 @@ var midscene_element_inspector = (() => {
48
48
  ));
49
49
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50
50
 
51
- // resolve-false:/empty-stub
51
+ // resolve-false:\empty-stub
52
52
  var require_empty_stub = __commonJS({
53
- "resolve-false:/empty-stub"(exports, module) {
53
+ "resolve-false:\\empty-stub"(exports, module) {
54
54
  "use strict";
55
55
  module.exports = {};
56
56
  }
@@ -755,6 +755,9 @@ ${indentStr}${after}`;
755
755
  function isButtonElement(node) {
756
756
  return node instanceof HTMLElement && node.tagName.toLowerCase() === "button";
757
757
  }
758
+ function isAElement(node) {
759
+ return node instanceof HTMLElement && node.tagName.toLowerCase() === "a";
760
+ }
758
761
  function isImgElement(node) {
759
762
  if (!includeBaseElement(node) && node instanceof Element) {
760
763
  const computedStyle = window.getComputedStyle(node);
@@ -805,7 +808,8 @@ ${indentStr}${after}`;
805
808
  "textarea",
806
809
  "select",
807
810
  "option",
808
- "img"
811
+ "img",
812
+ "a"
809
813
  ];
810
814
  for (const tagName of includeList) {
811
815
  const element = node.querySelectorAll(tagName);
@@ -1196,10 +1200,20 @@ ${indentStr}${after}`;
1196
1200
  return elementInfo;
1197
1201
  }
1198
1202
  if (isButtonElement(node)) {
1203
+ const rect2 = mergeElementAndChildrenRects(
1204
+ node,
1205
+ currentWindow,
1206
+ currentDocument,
1207
+ baseZoom,
1208
+ visibleOnly
1209
+ );
1210
+ if (!rect2) {
1211
+ return null;
1212
+ }
1199
1213
  const attributes = getNodeAttributes(node, currentWindow);
1200
1214
  const pseudo = getPseudoElementContent(node, currentWindow);
1201
1215
  const content = node.innerText || pseudo.before || pseudo.after || "";
1202
- const nodeHashId = midsceneGenerateHash(node, content, rect);
1216
+ const nodeHashId = midsceneGenerateHash(node, content, rect2);
1203
1217
  const selector = setDataForNode(node, nodeHashId, false, currentWindow);
1204
1218
  const elementInfo = {
1205
1219
  id: nodeHashId,
@@ -1212,12 +1226,12 @@ ${indentStr}${after}`;
1212
1226
  nodeType: "BUTTON Node" /* BUTTON */
1213
1227
  }),
1214
1228
  content,
1215
- rect,
1229
+ rect: rect2,
1216
1230
  center: [
1217
- Math.round(rect.left + rect.width / 2),
1218
- Math.round(rect.top + rect.height / 2)
1231
+ Math.round(rect2.left + rect2.width / 2),
1232
+ Math.round(rect2.top + rect2.height / 2)
1219
1233
  ],
1220
- zoom: rect.zoom
1234
+ zoom: rect2.zoom
1221
1235
  };
1222
1236
  return elementInfo;
1223
1237
  }
@@ -1279,6 +1293,32 @@ ${indentStr}${after}`;
1279
1293
  };
1280
1294
  return elementInfo;
1281
1295
  }
1296
+ if (isAElement(node)) {
1297
+ const attributes = getNodeAttributes(node, currentWindow);
1298
+ const pseudo = getPseudoElementContent(node, currentWindow);
1299
+ const content = node.innerText || pseudo.before || pseudo.after || "";
1300
+ const nodeHashId = midsceneGenerateHash(node, content, rect);
1301
+ const selector = setDataForNode(node, nodeHashId, false, currentWindow);
1302
+ const elementInfo = {
1303
+ id: nodeHashId,
1304
+ indexId: indexId++,
1305
+ nodeHashId,
1306
+ nodeType: "Anchor Node" /* A */,
1307
+ locator: selector,
1308
+ attributes: __spreadProps(__spreadValues({}, attributes), {
1309
+ htmlTagName: tagNameOfNode(node),
1310
+ nodeType: "Anchor Node" /* A */
1311
+ }),
1312
+ content,
1313
+ rect,
1314
+ center: [
1315
+ Math.round(rect.left + rect.width / 2),
1316
+ Math.round(rect.top + rect.height / 2)
1317
+ ],
1318
+ zoom: rect.zoom
1319
+ };
1320
+ return elementInfo;
1321
+ }
1282
1322
  if (isContainerElement(node)) {
1283
1323
  const attributes = getNodeAttributes(node, currentWindow);
1284
1324
  const nodeHashId = midsceneGenerateHash(node, "", rect);
@@ -1352,7 +1392,7 @@ ${indentStr}${after}`;
1352
1392
  node: elementInfo,
1353
1393
  children: []
1354
1394
  };
1355
- if ((elementInfo == null ? void 0 : elementInfo.nodeType) === "BUTTON Node" /* BUTTON */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "IMG Node" /* IMG */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "TEXT Node" /* TEXT */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "FORM_ITEM Node" /* FORM_ITEM */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "CONTAINER Node" /* CONTAINER */) {
1395
+ if ((elementInfo == null ? void 0 : elementInfo.nodeType) === "BUTTON Node" /* BUTTON */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "IMG Node" /* IMG */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "TEXT Node" /* TEXT */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "Anchor Node" /* A */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "FORM_ITEM Node" /* FORM_ITEM */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "CONTAINER Node" /* CONTAINER */) {
1356
1396
  return nodeInfo;
1357
1397
  }
1358
1398
  const rect = getRect(node, baseZoom, currentWindow);
@@ -1407,6 +1447,49 @@ ${indentStr}${after}`;
1407
1447
  children: topChildren
1408
1448
  };
1409
1449
  }
1450
+ function mergeElementAndChildrenRects(node, currentWindow, currentDocument, baseZoom = 1, visibleOnly = true) {
1451
+ const selfRect = elementRect(
1452
+ node,
1453
+ currentWindow,
1454
+ currentDocument,
1455
+ baseZoom,
1456
+ visibleOnly
1457
+ );
1458
+ if (!selfRect)
1459
+ return null;
1460
+ let minLeft = selfRect.left;
1461
+ let minTop = selfRect.top;
1462
+ let maxRight = selfRect.left + selfRect.width;
1463
+ let maxBottom = selfRect.top + selfRect.height;
1464
+ function traverse(child) {
1465
+ for (let i = 0; i < child.childNodes.length; i++) {
1466
+ const sub = child.childNodes[i];
1467
+ if (sub.nodeType === 1) {
1468
+ const rect = elementRect(
1469
+ sub,
1470
+ currentWindow,
1471
+ currentDocument,
1472
+ baseZoom,
1473
+ visibleOnly
1474
+ );
1475
+ if (rect) {
1476
+ minLeft = Math.min(minLeft, rect.left);
1477
+ minTop = Math.min(minTop, rect.top);
1478
+ maxRight = Math.max(maxRight, rect.left + rect.width);
1479
+ maxBottom = Math.max(maxBottom, rect.top + rect.height);
1480
+ }
1481
+ traverse(sub);
1482
+ }
1483
+ }
1484
+ }
1485
+ traverse(node);
1486
+ return __spreadProps(__spreadValues({}, selfRect), {
1487
+ left: minLeft,
1488
+ top: minTop,
1489
+ width: maxRight - minLeft,
1490
+ height: maxBottom - minTop
1491
+ });
1492
+ }
1410
1493
 
1411
1494
  // src/extractor/locator.ts
1412
1495
  var getElementIndex = (element) => {
@@ -1420,16 +1503,6 @@ ${indentStr}${after}`;
1420
1503
  }
1421
1504
  return index;
1422
1505
  };
1423
- var findFirstAncestorWithId = (element) => {
1424
- let current = element;
1425
- while (current == null ? void 0 : current.parentElement) {
1426
- if (current.id) {
1427
- return current;
1428
- }
1429
- current = current.parentElement;
1430
- }
1431
- return null;
1432
- };
1433
1506
  var getTextNodeIndex = (textNode) => {
1434
1507
  let index = 1;
1435
1508
  let current = textNode.previousSibling;
@@ -1442,11 +1515,16 @@ ${indentStr}${after}`;
1442
1515
  return index;
1443
1516
  };
1444
1517
  var getElementXPath = (element) => {
1518
+ var _a;
1445
1519
  if (element.nodeType === Node.TEXT_NODE) {
1446
1520
  const parentNode = element.parentNode;
1447
1521
  if (parentNode && parentNode.nodeType === Node.ELEMENT_NODE) {
1448
1522
  const parentXPath = getElementXPath(parentNode);
1449
1523
  const textIndex = getTextNodeIndex(element);
1524
+ const textContent = (_a = element.textContent) == null ? void 0 : _a.trim();
1525
+ if (textContent) {
1526
+ return `${parentXPath}/text()[${textIndex}][normalize-space()="${textContent}"]`;
1527
+ }
1450
1528
  return `${parentXPath}/text()[${textIndex}]`;
1451
1529
  }
1452
1530
  return "";
@@ -1460,22 +1538,6 @@ ${indentStr}${after}`;
1460
1538
  if (el === document.body) {
1461
1539
  return "/html/body";
1462
1540
  }
1463
- if (el.id) {
1464
- return `//*[@id="${el.id}"]`;
1465
- }
1466
- const ancestorWithId = findFirstAncestorWithId(el);
1467
- if (ancestorWithId) {
1468
- const ancestorPath = `//*[@id="${ancestorWithId.id}"]`;
1469
- let current = el;
1470
- const pathParts = [];
1471
- while (current && current !== ancestorWithId) {
1472
- const index2 = getElementIndex(current);
1473
- const tagName2 = current.nodeName.toLowerCase();
1474
- pathParts.unshift(`${tagName2}[${index2}]`);
1475
- current = current.parentElement;
1476
- }
1477
- return pathParts.length > 0 ? `${ancestorPath}/${pathParts.join("/")}` : ancestorPath;
1478
- }
1479
1541
  if (!el.parentNode) {
1480
1542
  return `/${el.nodeName.toLowerCase()}`;
1481
1543
  }
@@ -1490,8 +1552,8 @@ ${indentStr}${after}`;
1490
1552
  function generateXPaths(node) {
1491
1553
  if (!node)
1492
1554
  return [];
1493
- const xPath = getElementXPath(node);
1494
- return [xPath];
1555
+ const fullXPath = getElementXPath(node);
1556
+ return [fullXPath];
1495
1557
  }
1496
1558
  function getXpathsById(id) {
1497
1559
  const node = getNodeFromCacheList(id);
@@ -43,9 +43,9 @@ var midscene_element_inspector = (() => {
43
43
  mod
44
44
  ));
45
45
 
46
- // resolve-false:/empty-stub
46
+ // resolve-false:\empty-stub
47
47
  var require_empty_stub = __commonJS({
48
- "resolve-false:/empty-stub"(exports, module) {
48
+ "resolve-false:\\empty-stub"(exports, module) {
49
49
  "use strict";
50
50
  module.exports = {};
51
51
  }
@@ -611,6 +611,9 @@ var midscene_element_inspector = (() => {
611
611
  function isButtonElement(node) {
612
612
  return node instanceof HTMLElement && node.tagName.toLowerCase() === "button";
613
613
  }
614
+ function isAElement(node) {
615
+ return node instanceof HTMLElement && node.tagName.toLowerCase() === "a";
616
+ }
614
617
  function isImgElement(node) {
615
618
  if (!includeBaseElement(node) && node instanceof Element) {
616
619
  const computedStyle = window.getComputedStyle(node);
@@ -661,7 +664,8 @@ var midscene_element_inspector = (() => {
661
664
  "textarea",
662
665
  "select",
663
666
  "option",
664
- "img"
667
+ "img",
668
+ "a"
665
669
  ];
666
670
  for (const tagName of includeList) {
667
671
  const element = node.querySelectorAll(tagName);
@@ -1045,10 +1049,20 @@ var midscene_element_inspector = (() => {
1045
1049
  return elementInfo;
1046
1050
  }
1047
1051
  if (isButtonElement(node)) {
1052
+ const rect2 = mergeElementAndChildrenRects(
1053
+ node,
1054
+ currentWindow,
1055
+ currentDocument,
1056
+ baseZoom,
1057
+ visibleOnly
1058
+ );
1059
+ if (!rect2) {
1060
+ return null;
1061
+ }
1048
1062
  const attributes = getNodeAttributes(node, currentWindow);
1049
1063
  const pseudo = getPseudoElementContent(node, currentWindow);
1050
1064
  const content = node.innerText || pseudo.before || pseudo.after || "";
1051
- const nodeHashId = midsceneGenerateHash(node, content, rect);
1065
+ const nodeHashId = midsceneGenerateHash(node, content, rect2);
1052
1066
  const selector = setDataForNode(node, nodeHashId, false, currentWindow);
1053
1067
  const elementInfo = {
1054
1068
  id: nodeHashId,
@@ -1061,12 +1075,12 @@ var midscene_element_inspector = (() => {
1061
1075
  nodeType: "BUTTON Node" /* BUTTON */
1062
1076
  }),
1063
1077
  content,
1064
- rect,
1078
+ rect: rect2,
1065
1079
  center: [
1066
- Math.round(rect.left + rect.width / 2),
1067
- Math.round(rect.top + rect.height / 2)
1080
+ Math.round(rect2.left + rect2.width / 2),
1081
+ Math.round(rect2.top + rect2.height / 2)
1068
1082
  ],
1069
- zoom: rect.zoom
1083
+ zoom: rect2.zoom
1070
1084
  };
1071
1085
  return elementInfo;
1072
1086
  }
@@ -1128,6 +1142,32 @@ var midscene_element_inspector = (() => {
1128
1142
  };
1129
1143
  return elementInfo;
1130
1144
  }
1145
+ if (isAElement(node)) {
1146
+ const attributes = getNodeAttributes(node, currentWindow);
1147
+ const pseudo = getPseudoElementContent(node, currentWindow);
1148
+ const content = node.innerText || pseudo.before || pseudo.after || "";
1149
+ const nodeHashId = midsceneGenerateHash(node, content, rect);
1150
+ const selector = setDataForNode(node, nodeHashId, false, currentWindow);
1151
+ const elementInfo = {
1152
+ id: nodeHashId,
1153
+ indexId: indexId++,
1154
+ nodeHashId,
1155
+ nodeType: "Anchor Node" /* A */,
1156
+ locator: selector,
1157
+ attributes: __spreadProps(__spreadValues({}, attributes), {
1158
+ htmlTagName: tagNameOfNode(node),
1159
+ nodeType: "Anchor Node" /* A */
1160
+ }),
1161
+ content,
1162
+ rect,
1163
+ center: [
1164
+ Math.round(rect.left + rect.width / 2),
1165
+ Math.round(rect.top + rect.height / 2)
1166
+ ],
1167
+ zoom: rect.zoom
1168
+ };
1169
+ return elementInfo;
1170
+ }
1131
1171
  if (isContainerElement(node)) {
1132
1172
  const attributes = getNodeAttributes(node, currentWindow);
1133
1173
  const nodeHashId = midsceneGenerateHash(node, "", rect);
@@ -1197,7 +1237,7 @@ var midscene_element_inspector = (() => {
1197
1237
  node: elementInfo,
1198
1238
  children: []
1199
1239
  };
1200
- if ((elementInfo == null ? void 0 : elementInfo.nodeType) === "BUTTON Node" /* BUTTON */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "IMG Node" /* IMG */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "TEXT Node" /* TEXT */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "FORM_ITEM Node" /* FORM_ITEM */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "CONTAINER Node" /* CONTAINER */) {
1240
+ if ((elementInfo == null ? void 0 : elementInfo.nodeType) === "BUTTON Node" /* BUTTON */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "IMG Node" /* IMG */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "TEXT Node" /* TEXT */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "Anchor Node" /* A */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "FORM_ITEM Node" /* FORM_ITEM */ || (elementInfo == null ? void 0 : elementInfo.nodeType) === "CONTAINER Node" /* CONTAINER */) {
1201
1241
  return nodeInfo;
1202
1242
  }
1203
1243
  const rect = getRect(node, baseZoom, currentWindow);
@@ -1252,6 +1292,49 @@ var midscene_element_inspector = (() => {
1252
1292
  children: topChildren
1253
1293
  };
1254
1294
  }
1295
+ function mergeElementAndChildrenRects(node, currentWindow, currentDocument, baseZoom = 1, visibleOnly = true) {
1296
+ const selfRect = elementRect(
1297
+ node,
1298
+ currentWindow,
1299
+ currentDocument,
1300
+ baseZoom,
1301
+ visibleOnly
1302
+ );
1303
+ if (!selfRect)
1304
+ return null;
1305
+ let minLeft = selfRect.left;
1306
+ let minTop = selfRect.top;
1307
+ let maxRight = selfRect.left + selfRect.width;
1308
+ let maxBottom = selfRect.top + selfRect.height;
1309
+ function traverse(child) {
1310
+ for (let i = 0; i < child.childNodes.length; i++) {
1311
+ const sub = child.childNodes[i];
1312
+ if (sub.nodeType === 1) {
1313
+ const rect = elementRect(
1314
+ sub,
1315
+ currentWindow,
1316
+ currentDocument,
1317
+ baseZoom,
1318
+ visibleOnly
1319
+ );
1320
+ if (rect) {
1321
+ minLeft = Math.min(minLeft, rect.left);
1322
+ minTop = Math.min(minTop, rect.top);
1323
+ maxRight = Math.max(maxRight, rect.left + rect.width);
1324
+ maxBottom = Math.max(maxBottom, rect.top + rect.height);
1325
+ }
1326
+ traverse(sub);
1327
+ }
1328
+ }
1329
+ }
1330
+ traverse(node);
1331
+ return __spreadProps(__spreadValues({}, selfRect), {
1332
+ left: minLeft,
1333
+ top: minTop,
1334
+ width: maxRight - minLeft,
1335
+ height: maxBottom - minTop
1336
+ });
1337
+ }
1255
1338
 
1256
1339
  // src/extractor/debug.ts
1257
1340
  console.log(extractTextWithPosition(document.body, true));
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "Browser use",
9
9
  "Android use"
10
10
  ],
11
- "version": "1.0.2",
11
+ "version": "1.0.4",
12
12
  "repository": "https://github.com/web-infra-dev/midscene",
13
13
  "homepage": "https://midscenejs.com/",
14
14
  "jsnext:source": "./src/index.ts",
@@ -137,25 +137,6 @@
137
137
  "quiet": false
138
138
  }
139
139
  },
140
- "scripts": {
141
- "dev": "npm run build && npx npm-watch",
142
- "dev:server": "npm run build && ./bin/midscene-playground",
143
- "build": "modern build -c ./modern.config.ts",
144
- "postbuild": "node scripts/check-exports.js",
145
- "build:watch": "modern build -w -c ./modern.config.ts",
146
- "test": "vitest --run",
147
- "test:u": "vitest --run -u",
148
- "test:ai": "AI_TEST_TYPE=web npm run test",
149
- "test:ai:temp": "MIDSCENE_CACHE=true BRIDGE_MODE=true vitest --run tests/ai/bridge/open-new-tab.test.ts",
150
- "test:ai:bridge": "MIDSCENE_CACHE=true BRIDGE_MODE=true npm run test --inspect tests/ai/bridge/temp.test.ts",
151
- "test:ai:cache": "MIDSCENE_CACHE=true npm run test",
152
- "upgrade": "modern upgrade",
153
- "e2e": "playwright test --config=tests/playwright.config.ts",
154
- "e2e:report": "MIDSCENE_REPORT=true playwright test --config=tests/playwright.config.ts",
155
- "e2e:cache": "MIDSCENE_CACHE=true playwright test --config=tests/playwright.config.ts",
156
- "e2e:ui": "playwright test --config=tests/playwright.config.ts --ui",
157
- "e2e:ui:cache": "MIDSCENE_CACHE=true playwright test --config=tests/playwright.config.ts --ui"
158
- },
159
140
  "files": [
160
141
  "static",
161
142
  "dist",
@@ -164,8 +145,8 @@
164
145
  "bin"
165
146
  ],
166
147
  "dependencies": {
167
- "misoai-core": "1.0.1",
168
- "misoai-shared": "1.0.0",
148
+ "misoai-core": "1.0.4",
149
+ "misoai-shared": "1.0.1",
169
150
  "@xmldom/xmldom": "0.8.10",
170
151
  "cors": "2.8.5",
171
152
  "dayjs": "1.11.11",
@@ -217,5 +198,23 @@
217
198
  "access": "public",
218
199
  "registry": "https://registry.npmjs.org"
219
200
  },
220
- "license": "MIT"
221
- }
201
+ "license": "MIT",
202
+ "scripts": {
203
+ "dev": "npm run build && npx npm-watch",
204
+ "dev:server": "npm run build && ./bin/midscene-playground",
205
+ "build": "modern build -c ./modern.config.ts",
206
+ "postbuild": "node scripts/check-exports.js",
207
+ "build:watch": "modern build -w -c ./modern.config.ts",
208
+ "test": "vitest --run",
209
+ "test:u": "vitest --run -u",
210
+ "test:ai": "AI_TEST_TYPE=web npm run test",
211
+ "test:ai:bridge": "MIDSCENE_CACHE=true BRIDGE_MODE=true vitest --run tests/ai/bridge/open-new-tab.test.ts",
212
+ "test:ai:cache": "MIDSCENE_CACHE=true npm run test",
213
+ "upgrade": "modern upgrade",
214
+ "e2e": "playwright test --config=tests/playwright.config.ts",
215
+ "e2e:report": "MIDSCENE_REPORT=true playwright test --config=tests/playwright.config.ts",
216
+ "e2e:cache": "MIDSCENE_CACHE=true playwright test --config=tests/playwright.config.ts",
217
+ "e2e:ui": "playwright test --config=tests/playwright.config.ts --ui",
218
+ "e2e:ui:cache": "MIDSCENE_CACHE=true playwright test --config=tests/playwright.config.ts --ui"
219
+ }
220
+ }