@xbrowser/cli 1.22.0 → 1.23.0

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getPluginLoader,
3
3
  resetPluginLoader
4
- } from "./chunk-PIWNMC36.js";
4
+ } from "./chunk-A3MORKYR.js";
5
5
  import "./chunk-KFQGP6VL.js";
6
6
  export {
7
7
  getPluginLoader,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HumanInteractionManager
3
- } from "./chunk-TEXCXIBW.js";
3
+ } from "./chunk-LPW6QS4M.js";
4
4
  import {
5
5
  buildViewerUrl
6
6
  } from "./chunk-3OD76SUE.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HumanInteractionManager
3
- } from "./chunk-OMU63E6J.js";
3
+ } from "./chunk-FBQZ3PVD.js";
4
4
  import {
5
5
  buildViewerUrl
6
6
  } from "./chunk-TZPKFUBT.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-3OD76SUE.js";
4
4
  import {
5
5
  HumanInteractionManager
6
- } from "./chunk-NKW4A74J.js";
6
+ } from "./chunk-XTUAUFL3.js";
7
7
  import "./chunk-Q2DFJQGS.js";
8
8
  import "./chunk-KFQGP6VL.js";
9
9
 
@@ -222,20 +222,31 @@ var SessionReplayer = class {
222
222
  break;
223
223
  }
224
224
  case "scroll": {
225
- const [dir, distStr] = (action.value || "down:300").split(":");
226
- const dist = Number(distStr) || 300;
227
- const sign = dir === "up" ? -1 : dir === "left" ? 0 : 1;
228
225
  const selector = await this.resolveAndWait(action).catch(() => void 0);
229
- if (selector) {
230
- await page.evaluate(`
231
- (function() {
232
- const el = ${queryJS(selector)};
233
- if (el) el.scrollTop += ${sign * dist};
234
- })()
235
- `).catch(() => {
226
+ if (action.value) {
227
+ const [dir, distStr] = action.value.split(":");
228
+ const dist = Number(distStr) || 300;
229
+ const dx = dir === "left" ? -dist : dir === "right" ? dist : 0;
230
+ const dy = dir === "up" ? -dist : dir === "down" ? dist : 0;
231
+ if (selector) {
232
+ await page.evaluate(`
233
+ (function() {
234
+ const el = ${queryJS(selector)};
235
+ if (el) { el.scrollLeft += ${dx}; el.scrollTop += ${dy}; }
236
+ })()
237
+ `).catch(() => {
238
+ });
239
+ } else {
240
+ await page.evaluate(`window.scrollBy(${dx}, ${dy})`).catch(() => {
241
+ });
242
+ }
243
+ } else if (typeof action.scrollX === "number" || typeof action.scrollY === "number") {
244
+ const sx = action.scrollX ?? 0;
245
+ const sy = action.scrollY ?? 0;
246
+ await page.evaluate(`window.scrollTo(${sx}, ${sy})`).catch(() => {
236
247
  });
237
248
  } else {
238
- await page.evaluate(`window.scrollBy(0, ${sign * dist})`).catch(() => {
249
+ await page.evaluate(`window.scrollBy(0, 300)`).catch(() => {
239
250
  });
240
251
  }
241
252
  break;
@@ -406,12 +417,6 @@ var SessionReplayer = class {
406
417
  }, selector);
407
418
  break;
408
419
  }
409
- case "scroll": {
410
- await page.evaluate(() => {
411
- window.scrollBy(action.scrollX ?? 0, action.scrollY ?? 0);
412
- });
413
- break;
414
- }
415
420
  default:
416
421
  break;
417
422
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xbrowser/cli",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "Browser automation CLI for web scraping, headless browsing, SEO analysis, and AI agent workflows. A command-line alternative to Playwright, Puppeteer, and Selenium.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -72,30 +72,34 @@
72
72
  "scripts": {
73
73
  "build": "tsup",
74
74
  "dev": "tsup --watch",
75
- "lint": "eslint src/ bin/ --ext .ts",
75
+ "lint": "eslint src/ bin/ tests/ --ext .ts",
76
+ "lint:plugins": "eslint .xcli/plugins/ --ext .ts --max-warnings 0",
76
77
  "lint:plugin-contract": "node lint-scripts/check-plugin-contract.mjs && node lint-scripts/check-plugin-status.mjs",
77
78
  "lint:plugin-status": "node lint-scripts/check-plugin-status.mjs --update",
78
79
  "stealth:check": "vitest run tests/cdp-driver/stealth-health.test.ts tests/cdp-driver/stealth-audit.test.ts tests/cdp-driver/stealth-probe.test.ts",
79
80
  "lint:docs": "node lint-scripts/check-docs-consistency.mjs",
80
81
  "typecheck": "tsc --noEmit",
82
+ "typecheck:tests": "tsc -p tsconfig.tests.json --noEmit",
83
+ "typecheck:plugins": "tsc -p tsconfig.plugins.json --noEmit",
81
84
  "start": "node dist/cli.js",
82
85
  "test": "vitest run",
83
86
  "test:watch": "vitest",
84
87
  "test:e2e": "vitest run --config vitest.e2e.config.ts",
85
- "validate": "npm run typecheck && npm run lint && npm run lint:docs && npm run lint:plugin-contract && npm run build && npm test",
88
+ "test:arena": "vitest run --config vitest.arena.config.ts",
89
+ "validate": "npm run typecheck && npm run typecheck:plugins && npm run lint && npm run lint:plugins && npm run lint:docs && npm run lint:plugin-contract && npm run build && npm test",
86
90
  "prepare": "husky"
87
91
  },
88
92
  "dependencies": {
89
- "@dyyz1993/xcli-core": "^0.19.0",
93
+ "@dyyz1993/xcli-core": "^0.19.1",
90
94
  "@types/react-syntax-highlighter": "^15.5.13",
91
95
  "@types/turndown": "^5.0.6",
92
96
  "cheerio": "^1.2.0",
93
- "imapflow": "^1.3.3",
97
+ "imapflow": "^1.7.8",
94
98
  "lucide-react": "^1.14.0",
95
99
  "react-markdown": "^10.1.0",
96
100
  "react-syntax-highlighter": "^16.1.1",
97
101
  "remark-gfm": "^4.0.1",
98
- "sharp": "^0.34.5",
102
+ "sharp": "^0.35.4",
99
103
  "turndown": "^7.2.4",
100
104
  "turndown-plugin-gfm": "^1.0.2",
101
105
  "ws": "^8.21.0",
@@ -124,6 +128,6 @@
124
128
  ]
125
129
  },
126
130
  "optionalDependencies": {
127
- "undici": "^7.28.0"
131
+ "undici": "^7.29.1"
128
132
  }
129
133
  }