@xbrowser/cli 1.11.0 → 1.12.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/dist/{browser-V3JIWSTR.js → browser-3HQKDZQ6.js} +4 -3
  2. package/dist/{browser-Q5APBNF6.js → browser-ILXTEWH4.js} +1 -1
  3. package/dist/{browser-XNU7JQYC.js → browser-XPDMY2NX.js} +2 -2
  4. package/dist/{cdp-driver-VEK6BNN6.js → cdp-driver-ESH3PDE6.js} +1 -1
  5. package/dist/{cdp-driver-XFTTZI5O.js → cdp-driver-N2E2ZNSC.js} +1142 -12
  6. package/dist/{cdp-driver-GD6YBBGE.js → cdp-driver-YIKR4BUX.js} +2 -1
  7. package/dist/chunk-A6LPGFAL.js +437 -0
  8. package/dist/{chunk-7OFM755Z.js → chunk-DKM2JOZL.js} +202 -12
  9. package/dist/{chunk-ABXMBNQ6.js → chunk-H2A5JUK5.js} +37 -466
  10. package/dist/{chunk-BNO7OKO4.js → chunk-HBMEFSTB.js} +39 -0
  11. package/dist/chunk-KJTABK3Z.js +1255 -0
  12. package/dist/{chunk-DWDXEGVK.js → chunk-NKW4A74J.js} +9 -3
  13. package/dist/{chunk-SQHSZENE.js → chunk-OMU63E6J.js} +3 -22
  14. package/dist/{chunk-JEDP4PJW.js → chunk-OVW2UEWN.js} +878 -687
  15. package/dist/{chunk-XKQVUFUS.js → chunk-R6IJ6PIV.js} +2 -2
  16. package/dist/{chunk-WHPBNUKB.js → chunk-SH6OTPXN.js} +42 -46
  17. package/dist/{chunk-MWFHZUIY.js → chunk-TEXCXIBW.js} +1 -1
  18. package/dist/{chunk-XQ4HRPDJ.js → chunk-Z6CUR3VG.js} +1143 -12
  19. package/dist/{chunk-IIM5GOD7.js → chunk-ZTHE5RBZ.js} +7 -1
  20. package/dist/cli.js +1075 -569
  21. package/dist/{daemon-client-MMDRYCF5.js → daemon-client-7D6EZNOE.js} +42 -46
  22. package/dist/{daemon-client-Y2YSZCGK.js → daemon-client-HEGAXWGK.js} +1 -1
  23. package/dist/daemon-main.js +950 -499
  24. package/dist/{human-interaction-5AO42MBA.js → human-interaction-4YR2N6R6.js} +2 -2
  25. package/dist/{human-interaction-C5OEGXGO.js → human-interaction-Y5IDH6LD.js} +1 -1
  26. package/dist/{human-interaction-ISXZTAYY.js → human-interaction-ZUTR5AC2.js} +2 -2
  27. package/dist/index.d.ts +2 -0
  28. package/dist/index.js +1086 -578
  29. package/dist/{proxy-C6CK3UH5.js → proxy-LUR4U5YF.js} +2 -1
  30. package/dist/{recovery-J2ISVGUL.js → recovery-FTZGV6VY.js} +2 -2
  31. package/dist/{recovery-ZJVVHP7N.js → recovery-L5GLDX4O.js} +1 -1
  32. package/dist/{recovery-EF33LKRJ.js → recovery-Z3RDZENA.js} +2 -2
  33. package/dist/{session-replayer-WIUYVN5J.js → session-replayer-K4A6OI4M.js} +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-HVPUVVSA.js +0 -2194
@@ -1,3 +1,40 @@
1
+ // src/config.ts
2
+ import { homedir, tmpdir } from "os";
3
+ import { join } from "path";
4
+ import { loadConfig as coreLoadConfig, saveConfig as coreSaveConfig } from "@dyyz1993/xcli-core";
5
+ function getConfigSource() {
6
+ return { configDir: join(homedir() || tmpdir(), ".xbrowser") };
7
+ }
8
+ function loadConfig() {
9
+ return coreLoadConfig(getConfigSource());
10
+ }
11
+ function getConfigValue(key) {
12
+ const parts = key.split(".");
13
+ let obj = loadConfig();
14
+ for (const part of parts) {
15
+ if (obj && typeof obj === "object") {
16
+ obj = obj[part];
17
+ } else {
18
+ return void 0;
19
+ }
20
+ }
21
+ return obj;
22
+ }
23
+ function getCaptchaConfig() {
24
+ const config = loadConfig();
25
+ return {
26
+ notifyUrl: process.env.XBROWSER_NOTIFY_URL || config.captcha?.notifyUrl,
27
+ autoOpen: process.env.XBROWSER_AUTO_OPEN === "true" || config.captcha?.autoOpen === true,
28
+ timeout: parseInt(process.env.XBROWSER_CAPTCHA_TIMEOUT || "") || config.captcha?.timeout || 120,
29
+ previewPort: parseInt(process.env.XBROWSER_PREVIEW_PORT || "") || config.preview?.port || 9223
30
+ };
31
+ }
32
+ function resolveScreenshotsDir() {
33
+ const configured = getConfigValue("screenshots.dir");
34
+ if (typeof configured === "string" && configured.trim()) return configured.trim();
35
+ return join(tmpdir(), "xbrowser", "screenshots");
36
+ }
37
+
1
38
  // src/screencast.ts
2
39
  var ScreencastCapturer = class {
3
40
  interval;
@@ -140,5 +177,7 @@ var ScreencastCapturer = class {
140
177
  };
141
178
 
142
179
  export {
180
+ getCaptchaConfig,
181
+ resolveScreenshotsDir,
143
182
  ScreencastCapturer
144
183
  };