unrealon 1.1.6__py3-none-any.whl → 2.0.5__py3-none-any.whl

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 (144) hide show
  1. {unrealon-1.1.6.dist-info/licenses → unrealon-2.0.5.dist-info}/LICENSE +1 -1
  2. unrealon-2.0.5.dist-info/METADATA +491 -0
  3. unrealon-2.0.5.dist-info/RECORD +128 -0
  4. {unrealon-1.1.6.dist-info → unrealon-2.0.5.dist-info}/WHEEL +2 -1
  5. unrealon-2.0.5.dist-info/entry_points.txt +3 -0
  6. unrealon-2.0.5.dist-info/top_level.txt +3 -0
  7. unrealon_browser/__init__.py +5 -6
  8. unrealon_browser/cli/browser_cli.py +18 -9
  9. unrealon_browser/cli/interactive_mode.py +13 -4
  10. unrealon_browser/core/browser_manager.py +29 -16
  11. unrealon_browser/dto/__init__.py +21 -0
  12. unrealon_browser/dto/bot_detection.py +175 -0
  13. unrealon_browser/dto/models/config.py +9 -3
  14. unrealon_browser/managers/__init__.py +1 -1
  15. unrealon_browser/managers/logger_bridge.py +1 -4
  16. unrealon_browser/stealth/__init__.py +27 -0
  17. unrealon_browser/stealth/bypass_techniques.pyc +0 -0
  18. unrealon_browser/stealth/manager.pyc +0 -0
  19. unrealon_browser/stealth/nodriver_stealth.pyc +0 -0
  20. unrealon_browser/stealth/playwright_stealth.pyc +0 -0
  21. unrealon_browser/stealth/scanner_tester.pyc +0 -0
  22. unrealon_browser/stealth/undetected_chrome.pyc +0 -0
  23. unrealon_core/__init__.py +172 -0
  24. unrealon_core/config/__init__.py +16 -0
  25. unrealon_core/config/environment.py +151 -0
  26. unrealon_core/config/urls.py +94 -0
  27. unrealon_core/enums/__init__.py +24 -0
  28. unrealon_core/enums/status.py +216 -0
  29. unrealon_core/enums/types.py +240 -0
  30. unrealon_core/error_handling/__init__.py +45 -0
  31. unrealon_core/error_handling/circuit_breaker.py +292 -0
  32. unrealon_core/error_handling/error_context.py +324 -0
  33. unrealon_core/error_handling/recovery.py +371 -0
  34. unrealon_core/error_handling/retry.py +268 -0
  35. unrealon_core/exceptions/__init__.py +46 -0
  36. unrealon_core/exceptions/base.py +292 -0
  37. unrealon_core/exceptions/communication.py +22 -0
  38. unrealon_core/exceptions/driver.py +11 -0
  39. unrealon_core/exceptions/proxy.py +11 -0
  40. unrealon_core/exceptions/task.py +12 -0
  41. unrealon_core/exceptions/validation.py +17 -0
  42. unrealon_core/models/__init__.py +79 -0
  43. unrealon_core/models/arq_context.py +252 -0
  44. unrealon_core/models/arq_responses.py +125 -0
  45. unrealon_core/models/base.py +291 -0
  46. unrealon_core/models/bridge_stats.py +58 -0
  47. unrealon_core/models/communication.py +39 -0
  48. unrealon_core/models/connection_stats.py +47 -0
  49. unrealon_core/models/driver.py +30 -0
  50. unrealon_core/models/driver_details.py +98 -0
  51. unrealon_core/models/logging.py +28 -0
  52. unrealon_core/models/task.py +21 -0
  53. unrealon_core/models/typed_responses.py +210 -0
  54. unrealon_core/models/websocket/__init__.py +91 -0
  55. unrealon_core/models/websocket/base.py +49 -0
  56. unrealon_core/models/websocket/config.py +200 -0
  57. unrealon_core/models/websocket/driver.py +215 -0
  58. unrealon_core/models/websocket/errors.py +138 -0
  59. unrealon_core/models/websocket/heartbeat.py +100 -0
  60. unrealon_core/models/websocket/logging.py +261 -0
  61. unrealon_core/models/websocket/proxy.py +496 -0
  62. unrealon_core/models/websocket/tasks.py +275 -0
  63. unrealon_core/models/websocket/utils.py +153 -0
  64. unrealon_core/models/websocket_session.py +144 -0
  65. unrealon_core/monitoring/__init__.py +43 -0
  66. unrealon_core/monitoring/alerts.py +398 -0
  67. unrealon_core/monitoring/dashboard.py +307 -0
  68. unrealon_core/monitoring/health_check.py +354 -0
  69. unrealon_core/monitoring/metrics.py +352 -0
  70. unrealon_core/utils/__init__.py +11 -0
  71. unrealon_core/utils/time.py +61 -0
  72. unrealon_core/version.py +219 -0
  73. unrealon_driver/__init__.py +90 -51
  74. unrealon_driver/core_module/__init__.py +34 -0
  75. unrealon_driver/core_module/base.py +184 -0
  76. unrealon_driver/core_module/config.py +30 -0
  77. unrealon_driver/core_module/event_manager.py +127 -0
  78. unrealon_driver/core_module/protocols.py +98 -0
  79. unrealon_driver/core_module/registry.py +146 -0
  80. unrealon_driver/decorators/__init__.py +15 -0
  81. unrealon_driver/decorators/retry.py +117 -0
  82. unrealon_driver/decorators/schedule.py +137 -0
  83. unrealon_driver/decorators/task.py +61 -0
  84. unrealon_driver/decorators/timing.py +132 -0
  85. unrealon_driver/driver/__init__.py +20 -0
  86. unrealon_driver/driver/communication/__init__.py +10 -0
  87. unrealon_driver/driver/communication/session.py +203 -0
  88. unrealon_driver/driver/communication/websocket_client.py +205 -0
  89. unrealon_driver/driver/core/__init__.py +10 -0
  90. unrealon_driver/driver/core/config.py +175 -0
  91. unrealon_driver/driver/core/driver.py +221 -0
  92. unrealon_driver/driver/factory/__init__.py +9 -0
  93. unrealon_driver/driver/factory/manager_factory.py +130 -0
  94. unrealon_driver/driver/lifecycle/__init__.py +11 -0
  95. unrealon_driver/driver/lifecycle/daemon.py +76 -0
  96. unrealon_driver/driver/lifecycle/initialization.py +97 -0
  97. unrealon_driver/driver/lifecycle/shutdown.py +48 -0
  98. unrealon_driver/driver/monitoring/__init__.py +9 -0
  99. unrealon_driver/driver/monitoring/health.py +63 -0
  100. unrealon_driver/driver/utilities/__init__.py +10 -0
  101. unrealon_driver/driver/utilities/logging.py +51 -0
  102. unrealon_driver/driver/utilities/serialization.py +61 -0
  103. unrealon_driver/managers/__init__.py +32 -0
  104. unrealon_driver/managers/base.py +174 -0
  105. unrealon_driver/managers/browser.py +98 -0
  106. unrealon_driver/managers/cache.py +116 -0
  107. unrealon_driver/managers/http.py +107 -0
  108. unrealon_driver/managers/logger.py +286 -0
  109. unrealon_driver/managers/proxy.py +99 -0
  110. unrealon_driver/managers/registry.py +87 -0
  111. unrealon_driver/managers/threading.py +54 -0
  112. unrealon_driver/managers/update.py +107 -0
  113. unrealon_driver/utils/__init__.py +9 -0
  114. unrealon_driver/utils/time.py +10 -0
  115. unrealon-1.1.6.dist-info/METADATA +0 -625
  116. unrealon-1.1.6.dist-info/RECORD +0 -55
  117. unrealon-1.1.6.dist-info/entry_points.txt +0 -9
  118. unrealon_browser/managers/stealth.py +0 -388
  119. unrealon_driver/README.md +0 -0
  120. unrealon_driver/exceptions.py +0 -33
  121. unrealon_driver/html_analyzer/__init__.py +0 -32
  122. unrealon_driver/html_analyzer/cleaner.py +0 -657
  123. unrealon_driver/html_analyzer/config.py +0 -64
  124. unrealon_driver/html_analyzer/manager.py +0 -247
  125. unrealon_driver/html_analyzer/models.py +0 -115
  126. unrealon_driver/html_analyzer/websocket_analyzer.py +0 -157
  127. unrealon_driver/models/__init__.py +0 -31
  128. unrealon_driver/models/websocket.py +0 -98
  129. unrealon_driver/parser/__init__.py +0 -36
  130. unrealon_driver/parser/cli_manager.py +0 -142
  131. unrealon_driver/parser/daemon_manager.py +0 -403
  132. unrealon_driver/parser/managers/__init__.py +0 -25
  133. unrealon_driver/parser/managers/config.py +0 -293
  134. unrealon_driver/parser/managers/error.py +0 -412
  135. unrealon_driver/parser/managers/result.py +0 -321
  136. unrealon_driver/parser/parser_manager.py +0 -458
  137. unrealon_driver/smart_logging/__init__.py +0 -24
  138. unrealon_driver/smart_logging/models.py +0 -44
  139. unrealon_driver/smart_logging/smart_logger.py +0 -406
  140. unrealon_driver/smart_logging/unified_logger.py +0 -525
  141. unrealon_driver/websocket/__init__.py +0 -31
  142. unrealon_driver/websocket/client.py +0 -249
  143. unrealon_driver/websocket/config.py +0 -188
  144. unrealon_driver/websocket/manager.py +0 -90
@@ -0,0 +1,54 @@
1
+ """
2
+ Clean threading manager.
3
+ """
4
+
5
+ import asyncio
6
+ from concurrent.futures import ThreadPoolExecutor
7
+ from typing import Any, Callable, Optional, Dict
8
+ from pydantic import Field
9
+
10
+ from .base import BaseManager, ManagerConfig
11
+
12
+
13
+ class ThreadManagerConfig(ManagerConfig):
14
+ """Thread manager configuration."""
15
+ max_workers: int = Field(default=4, description="Max thread workers")
16
+
17
+
18
+ class ThreadManager(BaseManager):
19
+ """Simple thread pool manager."""
20
+
21
+ def __init__(self, config: ThreadManagerConfig):
22
+ super().__init__(config, "threading")
23
+ self.config: ThreadManagerConfig = config
24
+ self.executor: Optional[ThreadPoolExecutor] = None
25
+
26
+ async def _initialize(self) -> bool:
27
+ """Initialize thread pool."""
28
+ self.executor = ThreadPoolExecutor(
29
+ max_workers=self.config.max_workers,
30
+ thread_name_prefix="unrealon-driver"
31
+ )
32
+ return True
33
+
34
+ async def _shutdown(self):
35
+ """Shutdown thread pool."""
36
+ if self.executor:
37
+ self.executor.shutdown(wait=True)
38
+ self.executor = None
39
+
40
+ async def run_in_thread(self, func: Callable, *args, **kwargs) -> Any:
41
+ """Run function in thread pool."""
42
+ if not self.executor:
43
+ raise RuntimeError("Thread manager not initialized")
44
+
45
+ loop = asyncio.get_event_loop()
46
+ return await loop.run_in_executor(self.executor, func, *args, **kwargs)
47
+
48
+ async def _health_check(self) -> Dict[str, Any]:
49
+ """Thread manager health check."""
50
+ return {
51
+ "status": "ok",
52
+ "max_workers": self.config.max_workers,
53
+ "active": self.executor is not None
54
+ }
@@ -0,0 +1,107 @@
1
+ """
2
+ Clean update manager for driver updates.
3
+ """
4
+
5
+ import asyncio
6
+ from typing import Dict, Any, Optional
7
+ from pydantic import Field
8
+
9
+ from .base import BaseManager, ManagerConfig
10
+
11
+
12
+ class UpdateManagerConfig(ManagerConfig):
13
+ """Update manager configuration."""
14
+ check_interval: int = Field(default=3600, description="Update check interval seconds")
15
+ auto_update: bool = Field(default=False, description="Enable auto updates")
16
+ update_url: Optional[str] = Field(default=None, description="Update server URL")
17
+
18
+
19
+ class UpdateManager(BaseManager):
20
+ """Simple update manager."""
21
+
22
+ def __init__(self, config: UpdateManagerConfig):
23
+ super().__init__(config, "update")
24
+ self.config: UpdateManagerConfig = config
25
+ self._check_task: Optional[asyncio.Task] = None
26
+ self.last_check: Optional[str] = None
27
+ self.update_available: bool = False
28
+
29
+ async def _initialize(self) -> bool:
30
+ """Initialize update manager."""
31
+ if self.config.update_url:
32
+ # Start update check task
33
+ self._check_task = asyncio.create_task(self._update_check_loop())
34
+
35
+ return True
36
+
37
+ async def _shutdown(self):
38
+ """Shutdown update manager."""
39
+ if self._check_task:
40
+ self._check_task.cancel()
41
+ try:
42
+ await self._check_task
43
+ except asyncio.CancelledError:
44
+ pass
45
+
46
+ async def _update_check_loop(self):
47
+ """Background update checking."""
48
+ while True:
49
+ try:
50
+ await asyncio.sleep(self.config.check_interval)
51
+ await self.check_for_updates()
52
+
53
+ except asyncio.CancelledError:
54
+ break
55
+ except Exception as e:
56
+ self.logger.error(f"Update check error: {e}")
57
+
58
+ async def check_for_updates(self) -> bool:
59
+ """Check for available updates."""
60
+ try:
61
+ # Placeholder for actual update checking logic
62
+ self.logger.info("Checking for updates...")
63
+
64
+ # TODO: Implement actual update checking
65
+ # This would typically involve:
66
+ # 1. Fetching version info from update server
67
+ # 2. Comparing with current version
68
+ # 3. Setting update_available flag
69
+
70
+ self.last_check = "checked"
71
+ return False
72
+
73
+ except Exception as e:
74
+ self.logger.error(f"Update check failed: {e}")
75
+ return False
76
+
77
+ async def perform_update(self) -> bool:
78
+ """Perform driver update."""
79
+ try:
80
+ if not self.update_available:
81
+ self.logger.info("No updates available")
82
+ return False
83
+
84
+ # Placeholder for actual update logic
85
+ self.logger.info("Performing update...")
86
+
87
+ # TODO: Implement actual update process
88
+ # This would typically involve:
89
+ # 1. Downloading new version
90
+ # 2. Validating download
91
+ # 3. Installing update
92
+ # 4. Restarting driver
93
+
94
+ return True
95
+
96
+ except Exception as e:
97
+ self.logger.error(f"Update failed: {e}")
98
+ return False
99
+
100
+ async def _health_check(self) -> Dict[str, Any]:
101
+ """Update manager health check."""
102
+ return {
103
+ "status": "ok",
104
+ "last_check": self.last_check,
105
+ "update_available": self.update_available,
106
+ "auto_update": self.config.auto_update
107
+ }
@@ -0,0 +1,9 @@
1
+ """
2
+ Utility functions for UnrealOn Driver.
3
+ """
4
+
5
+ from .time import utc_now
6
+
7
+ __all__ = [
8
+ "utc_now",
9
+ ]
@@ -0,0 +1,10 @@
1
+ """
2
+ Time utilities for UnrealOn Driver.
3
+ """
4
+
5
+ from datetime import datetime, timezone
6
+
7
+
8
+ def utc_now() -> datetime:
9
+ """Get current UTC time."""
10
+ return datetime.now(timezone.utc)