@xbrowser/cli 1.20.0 → 1.22.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.
Files changed (35) hide show
  1. package/README.md +1 -0
  2. package/dist/{browser-Y6B3NS4Q.js → browser-BVRFSUXU.js} +3 -2
  3. package/dist/{browser-NVC7MTML.js → browser-DSYUAE7H.js} +5 -5
  4. package/dist/{browser-PBBC7RAV.js → browser-Q67BJTI2.js} +6 -4
  5. package/dist/{cdp-driver-QYFA4QTP.js → cdp-driver-DC7EIUG5.js} +4 -3
  6. package/dist/{cdp-driver-Z2PLAO42.js → cdp-driver-T7D6H2RW.js} +368 -510
  7. package/dist/{cdp-driver-73F5CVH2.js → cdp-driver-WWO2UZDR.js} +4 -3
  8. package/dist/{chunk-76EKW7YJ.js → chunk-2Q3GQRUP.js} +3 -3
  9. package/dist/{chunk-UYEJ66VX.js → chunk-4OU37CXP.js} +387 -540
  10. package/dist/{chunk-H2A5JUK5.js → chunk-75DNUI6M.js} +9 -0
  11. package/dist/{chunk-FDU5BCPV.js → chunk-7OP2ISEY.js} +378 -540
  12. package/dist/{chunk-3FWLW7FS.js → chunk-A7NEA4PA.js} +39 -1
  13. package/dist/chunk-GYB5BOSP.js +602 -0
  14. package/dist/{chunk-T2KUVO4H.js → chunk-IFKJO2UR.js} +393 -546
  15. package/dist/{chunk-NODRQGOK.js → chunk-IR6C24P7.js} +97 -0
  16. package/dist/{chunk-3KZ34AUC.js → chunk-MYH6FIBZ.js} +2 -1
  17. package/dist/{chunk-75TLPVVZ.js → chunk-T4WTKBWI.js} +2 -2
  18. package/dist/{chunk-HBHOKZPN.js → chunk-V6KGBU5J.js} +97 -0
  19. package/dist/{chunk-IWVG4XYZ.js → chunk-VCVDILH6.js} +2 -1
  20. package/dist/{chunk-A6LPGFAL.js → chunk-WYETQ5C7.js} +1 -1
  21. package/dist/cli.js +25 -13
  22. package/dist/daemon-main.js +20 -14
  23. package/dist/index.d.ts +136 -1
  24. package/dist/index.js +29 -18
  25. package/dist/keep-awake-M4KJS4B4.js +29 -0
  26. package/dist/{launcher-44STYRJC.js → launcher-IK2FKW6T.js} +1 -1
  27. package/dist/{launcher-EXJHHAUL.js → launcher-LUOMMGZC.js} +1 -1
  28. package/dist/{proxy-LUR4U5YF.js → proxy-NKCYE76M.js} +2 -2
  29. package/dist/{session-recorder-SLDBENVF.js → session-recorder-563ISSJK.js} +1 -1
  30. package/dist/{session-recorder-3BEVWHOK.js → session-recorder-GEZVQBKW.js} +1 -1
  31. package/dist/session-replayer-XM5L7LFD.js +927 -0
  32. package/dist/stealth-2AA2FSNN.js +29 -0
  33. package/dist/stealth-JOXGV34D.js +29 -0
  34. package/package.json +2 -1
  35. package/dist/session-replayer-SBYJXQZZ.js +0 -413
package/dist/index.js CHANGED
@@ -1,7 +1,15 @@
1
+ import {
2
+ extractAndSave,
3
+ extractRecording,
4
+ printExtractSummary
5
+ } from "./chunk-X46HDAOT.js";
1
6
  import {
2
7
  filterRecording,
3
8
  parseExcludeTypes
4
9
  } from "./chunk-ANVL2ID2.js";
10
+ import {
11
+ SessionRecorder
12
+ } from "./chunk-IR6C24P7.js";
5
13
  import {
6
14
  closeAllSessions,
7
15
  closeEphemeralContext,
@@ -18,7 +26,7 @@ import {
18
26
  resolveLaunchOpts,
19
27
  saveSessionDiskMeta,
20
28
  setActivePage
21
- } from "./chunk-76EKW7YJ.js";
29
+ } from "./chunk-2Q3GQRUP.js";
22
30
  import {
23
31
  detectAntiBot,
24
32
  formatDetectionMessage
@@ -77,24 +85,20 @@ import {
77
85
  generateJSScript,
78
86
  generatePythonScript
79
87
  } from "./chunk-ETCO4SNK.js";
80
- import {
81
- extractAndSave,
82
- extractRecording,
83
- printExtractSummary
84
- } from "./chunk-X46HDAOT.js";
88
+ import "./chunk-7OP2ISEY.js";
85
89
  import {
86
90
  rand,
87
91
  sleep,
88
92
  wheelDelta
89
- } from "./chunk-FDU5BCPV.js";
90
- import "./chunk-3KZ34AUC.js";
93
+ } from "./chunk-GYB5BOSP.js";
94
+ import "./chunk-MYH6FIBZ.js";
91
95
  import {
92
96
  errMsg
93
97
  } from "./chunk-GDKLH7ZY.js";
94
98
  import {
95
99
  CDPInterceptorProxy,
96
100
  advise
97
- } from "./chunk-A6LPGFAL.js";
101
+ } from "./chunk-WYETQ5C7.js";
98
102
  import {
99
103
  automationSignalsRule,
100
104
  createRuleEngine,
@@ -106,10 +110,7 @@ import {
106
110
  mouseTrajectoryRule,
107
111
  networkAnomalyRule,
108
112
  pageLifecycleRule
109
- } from "./chunk-H2A5JUK5.js";
110
- import {
111
- SessionRecorder
112
- } from "./chunk-NODRQGOK.js";
113
+ } from "./chunk-75DNUI6M.js";
113
114
  import {
114
115
  addKnownIssue,
115
116
  getKnowledgePath,
@@ -8599,7 +8600,7 @@ async function executeCommand(commandName, params, sessionName = "default", extr
8599
8600
  }
8600
8601
  let targetPageOverride = null;
8601
8602
  if (_target && extraOpts?.cdpEndpoint) {
8602
- const { findTargetPage } = await import("./browser-NVC7MTML.js");
8603
+ const { findTargetPage } = await import("./browser-Q67BJTI2.js");
8603
8604
  targetPageOverride = await findTargetPage(extraOpts.cdpEndpoint, _target);
8604
8605
  if (!targetPageOverride) {
8605
8606
  return errorResult(`Target "${_target}" not found. Use 'xbrowser targets --cdp ${extraOpts.cdpEndpoint}' to list available pages.`);
@@ -12681,6 +12682,16 @@ async function handleReplay(args, options, mode) {
12681
12682
  }
12682
12683
  return;
12683
12684
  }
12685
+ if (result.ok && mode !== "json" && mode !== "yaml") {
12686
+ const healed = typeof result.healed === "number" ? result.healed : 0;
12687
+ if (healed > 0) {
12688
+ console.log(`
12689
+ Self-healed ${healed} action(s):`);
12690
+ for (const d of result.healedDetails ?? []) {
12691
+ console.log(` - step ${d.index + 1}: ${d.strategy}`);
12692
+ }
12693
+ }
12694
+ }
12684
12695
  outputResult(result, mode);
12685
12696
  }
12686
12697
  async function handleConvert(args, _mode) {
@@ -12782,7 +12793,7 @@ async function handleFilter(args, _mode, options) {
12782
12793
  }
12783
12794
  }
12784
12795
  async function handleGeneratePlugin(sessionName, pluginName, outputDir) {
12785
- const { SessionRecorder: SessionRecorder2 } = await import("./session-recorder-SLDBENVF.js");
12796
+ const { SessionRecorder: SessionRecorder2 } = await import("./session-recorder-563ISSJK.js");
12786
12797
  const { readSiteKnowledge: readSiteKnowledge2, toMarkdown } = await import("./site-knowledge-SYC6VCDB.js");
12787
12798
  const { mkdirSync: mkdirSync11, writeFileSync: writeFileSync13 } = await import("fs");
12788
12799
  const { join: join16 } = await import("path");
@@ -14822,7 +14833,7 @@ Run "xbrowser ${command} ${subCommand} --help" to see available parameters.`
14822
14833
  const targetPage = pages[cmdTabIndex];
14823
14834
  await targetPage.bringToFront().catch(() => {
14824
14835
  });
14825
- const { setActivePage: setActivePage2 } = await import("./browser-NVC7MTML.js");
14836
+ const { setActivePage: setActivePage2 } = await import("./browser-Q67BJTI2.js");
14826
14837
  setActivePage2(session, targetPage);
14827
14838
  }
14828
14839
  }
@@ -17995,7 +18006,7 @@ var DataCollector = class {
17995
18006
  return results;
17996
18007
  }
17997
18008
  async createBrowserContext() {
17998
- const { launch } = await import("./cdp-driver-QYFA4QTP.js");
18009
+ const { launch } = await import("./cdp-driver-WWO2UZDR.js");
17999
18010
  const { browser } = await launch({
18000
18011
  headless: true,
18001
18012
  args: ["--no-sandbox", "--disable-setuid-sandbox"]
@@ -18035,7 +18046,7 @@ var DataCollector = class {
18035
18046
 
18036
18047
  // src/cdp-interceptor/index.ts
18037
18048
  async function createCDPInterceptor(config) {
18038
- const { CDPInterceptorProxy: CDPInterceptorProxy2 } = await import("./proxy-LUR4U5YF.js");
18049
+ const { CDPInterceptorProxy: CDPInterceptorProxy2 } = await import("./proxy-NKCYE76M.js");
18039
18050
  const proxy = new CDPInterceptorProxy2(config);
18040
18051
  await proxy.start();
18041
18052
  return proxy;
@@ -0,0 +1,29 @@
1
+ import "./chunk-KFQGP6VL.js";
2
+
3
+ // src/utils/keep-awake.ts
4
+ import { spawn } from "child_process";
5
+ function startKeepAwake() {
6
+ if (process.platform !== "darwin") return { dispose: () => {
7
+ } };
8
+ try {
9
+ const child = spawn("caffeinate", ["-i", "-w", String(process.pid)], {
10
+ stdio: "ignore",
11
+ detached: false
12
+ });
13
+ return {
14
+ pid: child.pid,
15
+ dispose: () => {
16
+ try {
17
+ child.kill("SIGTERM");
18
+ } catch {
19
+ }
20
+ }
21
+ };
22
+ } catch {
23
+ return { dispose: () => {
24
+ } };
25
+ }
26
+ }
27
+ export {
28
+ startKeepAwake
29
+ };
@@ -7,7 +7,7 @@ import {
7
7
  joinCdpHttpUrl,
8
8
  killChrome,
9
9
  launchChrome
10
- } from "./chunk-3KZ34AUC.js";
10
+ } from "./chunk-MYH6FIBZ.js";
11
11
  import "./chunk-GDKLH7ZY.js";
12
12
  import "./chunk-KFQGP6VL.js";
13
13
  export {
@@ -7,7 +7,7 @@ import {
7
7
  joinCdpHttpUrl,
8
8
  killChrome,
9
9
  launchChrome
10
- } from "./chunk-IWVG4XYZ.js";
10
+ } from "./chunk-VCVDILH6.js";
11
11
  import "./chunk-3RG5ZIWI.js";
12
12
  export {
13
13
  ANTI_DETECT_ARGS,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CDPInterceptorProxy
3
- } from "./chunk-A6LPGFAL.js";
4
- import "./chunk-H2A5JUK5.js";
3
+ } from "./chunk-WYETQ5C7.js";
4
+ import "./chunk-75DNUI6M.js";
5
5
  import "./chunk-KFQGP6VL.js";
6
6
  export {
7
7
  CDPInterceptorProxy
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SessionRecorder
3
- } from "./chunk-NODRQGOK.js";
3
+ } from "./chunk-IR6C24P7.js";
4
4
  import "./chunk-OZKD3W4X.js";
5
5
  import "./chunk-KFQGP6VL.js";
6
6
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SessionRecorder
3
- } from "./chunk-HBHOKZPN.js";
3
+ } from "./chunk-V6KGBU5J.js";
4
4
  import "./chunk-KFQGP6VL.js";
5
5
  export {
6
6
  SessionRecorder