@xbrowser/cli 1.9.8 → 1.9.9

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 (39) hide show
  1. package/dist/{anti-bot-MCVM6IFB.js → anti-bot-DR56Y63V.js} +1 -1
  2. package/dist/{browser-GT4BMX6X.js → browser-FFYPFTBV.js} +1 -1
  3. package/dist/{browser-43YXUIML.js → browser-RHWUAMTB.js} +2 -2
  4. package/dist/{browser-SJWPJFN7.js → browser-YCO4GJMZ.js} +2 -2
  5. package/dist/{cdp-driver-WAFYSIIW.js → cdp-driver-2T4P4ZE2.js} +87 -1
  6. package/dist/{cdp-driver-PUZLDSQU.js → cdp-driver-J3YQ4LJV.js} +1 -1
  7. package/dist/chunk-3OD76SUE.js +20 -0
  8. package/dist/chunk-43TEMG4U.js +9 -0
  9. package/dist/{chunk-C3LIGO4V.js → chunk-4452SPFI.js} +906 -16
  10. package/dist/{chunk-VEWTHYDG.js → chunk-5UGR6MUK.js} +906 -16
  11. package/dist/{chunk-ENCEMM7Z.js → chunk-6OZWKXSW.js} +15 -16
  12. package/dist/{chunk-7ZDWM6T2.js → chunk-BNO7OKO4.js} +5 -6
  13. package/dist/{chunk-24SY6PE5.js → chunk-CG3D3CHY.js} +1 -8
  14. package/dist/{chunk-ZJHQPMCY.js → chunk-DWDXEGVK.js} +5 -6
  15. package/dist/{chunk-A4YHJW3Z.js → chunk-GUTBIYFW.js} +101 -16
  16. package/dist/{chunk-DPJNCMLC.js → chunk-INTQPBYF.js} +7 -0
  17. package/dist/{human-interaction-OU7LZ6OZ.js → chunk-MWFHZUIY.js} +6 -7
  18. package/dist/chunk-Q2DFJQGS.js +128 -0
  19. package/dist/{chunk-GM3HWQ5U.js → chunk-RRBXV7KE.js} +87 -1
  20. package/dist/{chunk-PBDID7SE.js → chunk-RZM5CNIY.js} +15 -16
  21. package/dist/{human-interaction-HJTXFVQS.js → chunk-SQHSZENE.js} +2 -2
  22. package/dist/chunk-TZPKFUBT.js +20 -0
  23. package/dist/{chunk-YAUG3NSI.js → chunk-YMUSHPU4.js} +16 -128
  24. package/dist/cli.js +41 -28
  25. package/dist/{daemon-client-4HJENICO.js → daemon-client-GKEPT4NY.js} +15 -3
  26. package/dist/{daemon-client-CMRAWXTN.js → daemon-client-O6BYVRXV.js} +4 -1
  27. package/dist/daemon-main.js +635 -57
  28. package/dist/human-interaction-5AO42MBA.js +8 -0
  29. package/dist/{human-interaction-2DZK4MW7.js → human-interaction-C5OEGXGO.js} +1 -1
  30. package/dist/human-interaction-ISXZTAYY.js +8 -0
  31. package/dist/index.d.ts +167 -2
  32. package/dist/index.js +173 -63
  33. package/dist/recovery-EF33LKRJ.js +77 -0
  34. package/dist/recovery-J2ISVGUL.js +77 -0
  35. package/dist/recovery-ZJVVHP7N.js +76 -0
  36. package/dist/{session-recorder-K3K63Q33.js → session-recorder-H3KEYU26.js} +1 -1
  37. package/dist/{session-recorder-AG6CH6EI.js → session-recorder-QRZMKFVL.js} +1 -1
  38. package/dist/{session-replayer-V4MP6M6I.js → session-replayer-LJUC4TI7.js} +24 -7
  39. package/package.json +1 -1
@@ -31,7 +31,7 @@ var SessionReplayer = class {
31
31
  if (this.opts.page) {
32
32
  this.page = this.opts.page;
33
33
  } else if (this.opts.cdpUrl) {
34
- const { launch } = await import("./cdp-driver-PUZLDSQU.js");
34
+ const { launch } = await import("./cdp-driver-J3YQ4LJV.js");
35
35
  const { browser } = await launch({ cdpEndpoint: this.opts.cdpUrl });
36
36
  let contexts = browser.contexts();
37
37
  for (let i = 0; i < 10 && contexts.length === 0; i++) {
@@ -79,6 +79,11 @@ var SessionReplayer = class {
79
79
  const page = this.page;
80
80
  const timeout = this.opts.stepTimeout;
81
81
  switch (action.type) {
82
+ // Proactive sensing actions are observations, not user actions — skip
83
+ // them during replay (they don't represent anything the user did).
84
+ case "popup_appear":
85
+ case "discovered_filters":
86
+ return;
82
87
  case "navigation":
83
88
  await page.goto(action.url, { waitUntil: "load", timeout });
84
89
  break;
@@ -153,7 +158,19 @@ var SessionReplayer = class {
153
158
  }
154
159
  case "hover": {
155
160
  const selector = await this.resolveAndWait(action);
156
- await page.hover(selector);
161
+ if (selector) {
162
+ await page.hover(selector);
163
+ }
164
+ const firstPopup = action.hoverContext?.appeared?.[0];
165
+ if (firstPopup?.selector) {
166
+ try {
167
+ await page.waitForSelector(firstPopup.selector, {
168
+ state: "visible",
169
+ timeout: 1e3
170
+ });
171
+ } catch {
172
+ }
173
+ }
157
174
  break;
158
175
  }
159
176
  case "drag": {
@@ -257,7 +274,9 @@ var SessionReplayer = class {
257
274
  * Returns the first matching selector, or throws if none match.
258
275
  * Fallback order:
259
276
  * 1. Primary CSS selector (always tried first)
260
- * 2. textFallback selector (for low-confidence selectors when primary fails)
277
+ * 2. textFallback selector (used when primary fails — not just for low
278
+ * confidence, since high-confidence selectors from dynamic attributes
279
+ * like data-spm-anchor-id can also fail on replay)
261
280
  * 3. Tag-based fallback (last resort)
262
281
  */
263
282
  async resolveAndWait(action) {
@@ -267,10 +286,8 @@ var SessionReplayer = class {
267
286
  const timeout = this.opts.stepTimeout;
268
287
  const candidates = [];
269
288
  if (el.selector) candidates.push(el.selector);
270
- if (el.confidence === "low" && el.textFallback?.selector) {
271
- if (!candidates.includes(el.textFallback.selector)) {
272
- candidates.push(el.textFallback.selector);
273
- }
289
+ if (el.textFallback?.selector && !candidates.includes(el.textFallback.selector)) {
290
+ candidates.push(el.textFallback.selector);
274
291
  }
275
292
  if (el.tag && !candidates.includes(el.tag)) {
276
293
  candidates.push(el.tag);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xbrowser/cli",
3
- "version": "1.9.8",
3
+ "version": "1.9.9",
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": {