unrealon 1.0.9__py3-none-any.whl → 1.1.1__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 (302) hide show
  1. unrealon/__init__.py +23 -21
  2. unrealon-1.1.1.dist-info/METADATA +722 -0
  3. unrealon-1.1.1.dist-info/RECORD +82 -0
  4. {unrealon-1.0.9.dist-info → unrealon-1.1.1.dist-info}/WHEEL +1 -1
  5. unrealon-1.1.1.dist-info/entry_points.txt +9 -0
  6. {unrealon-1.0.9.dist-info → unrealon-1.1.1.dist-info/licenses}/LICENSE +1 -1
  7. unrealon_bridge/__init__.py +114 -0
  8. unrealon_bridge/cli.py +316 -0
  9. unrealon_bridge/client/__init__.py +93 -0
  10. unrealon_bridge/client/base.py +78 -0
  11. unrealon_bridge/client/commands.py +89 -0
  12. unrealon_bridge/client/connection.py +90 -0
  13. unrealon_bridge/client/events.py +65 -0
  14. unrealon_bridge/client/health.py +38 -0
  15. unrealon_bridge/client/html_parser.py +146 -0
  16. unrealon_bridge/client/logging.py +139 -0
  17. unrealon_bridge/client/proxy.py +70 -0
  18. unrealon_bridge/client/scheduler.py +450 -0
  19. unrealon_bridge/client/session.py +70 -0
  20. unrealon_bridge/configs/__init__.py +14 -0
  21. unrealon_bridge/configs/bridge_config.py +212 -0
  22. unrealon_bridge/configs/bridge_config.yaml +39 -0
  23. unrealon_bridge/models/__init__.py +138 -0
  24. unrealon_bridge/models/base.py +28 -0
  25. unrealon_bridge/models/command.py +41 -0
  26. unrealon_bridge/models/events.py +40 -0
  27. unrealon_bridge/models/html_parser.py +79 -0
  28. unrealon_bridge/models/logging.py +55 -0
  29. unrealon_bridge/models/parser.py +63 -0
  30. unrealon_bridge/models/proxy.py +41 -0
  31. unrealon_bridge/models/requests.py +95 -0
  32. unrealon_bridge/models/responses.py +88 -0
  33. unrealon_bridge/models/scheduler.py +592 -0
  34. unrealon_bridge/models/session.py +28 -0
  35. unrealon_bridge/server/__init__.py +91 -0
  36. unrealon_bridge/server/base.py +171 -0
  37. unrealon_bridge/server/handlers/__init__.py +23 -0
  38. unrealon_bridge/server/handlers/command.py +110 -0
  39. unrealon_bridge/server/handlers/html_parser.py +139 -0
  40. unrealon_bridge/server/handlers/logging.py +95 -0
  41. unrealon_bridge/server/handlers/parser.py +95 -0
  42. unrealon_bridge/server/handlers/proxy.py +75 -0
  43. unrealon_bridge/server/handlers/scheduler.py +545 -0
  44. unrealon_bridge/server/handlers/session.py +66 -0
  45. unrealon_browser/__init__.py +61 -18
  46. unrealon_browser/{src/cli → cli}/browser_cli.py +6 -13
  47. unrealon_browser/{src/cli → cli}/cookies_cli.py +5 -1
  48. unrealon_browser/{src/core → core}/browser_manager.py +2 -2
  49. unrealon_browser/{src/managers → managers}/captcha.py +1 -1
  50. unrealon_browser/{src/managers → managers}/cookies.py +1 -1
  51. unrealon_browser/managers/logger_bridge.py +231 -0
  52. unrealon_browser/{src/managers → managers}/profile.py +1 -1
  53. unrealon_driver/__init__.py +73 -19
  54. unrealon_driver/browser/__init__.py +8 -0
  55. unrealon_driver/browser/config.py +74 -0
  56. unrealon_driver/browser/manager.py +416 -0
  57. unrealon_driver/exceptions.py +28 -0
  58. unrealon_driver/parser/__init__.py +55 -0
  59. unrealon_driver/parser/cli_manager.py +141 -0
  60. unrealon_driver/parser/daemon_manager.py +227 -0
  61. unrealon_driver/parser/managers/__init__.py +46 -0
  62. unrealon_driver/parser/managers/browser.py +51 -0
  63. unrealon_driver/parser/managers/config.py +281 -0
  64. unrealon_driver/parser/managers/error.py +412 -0
  65. unrealon_driver/parser/managers/html.py +732 -0
  66. unrealon_driver/parser/managers/logging.py +609 -0
  67. unrealon_driver/parser/managers/result.py +321 -0
  68. unrealon_driver/parser/parser_manager.py +628 -0
  69. unrealon/sdk_config.py +0 -88
  70. unrealon-1.0.9.dist-info/METADATA +0 -810
  71. unrealon-1.0.9.dist-info/RECORD +0 -246
  72. unrealon_browser/pyproject.toml +0 -182
  73. unrealon_browser/src/__init__.py +0 -62
  74. unrealon_browser/src/managers/logger_bridge.py +0 -395
  75. unrealon_driver/README.md +0 -204
  76. unrealon_driver/pyproject.toml +0 -187
  77. unrealon_driver/src/__init__.py +0 -90
  78. unrealon_driver/src/cli/__init__.py +0 -10
  79. unrealon_driver/src/cli/main.py +0 -66
  80. unrealon_driver/src/cli/simple.py +0 -510
  81. unrealon_driver/src/config/__init__.py +0 -11
  82. unrealon_driver/src/config/auto_config.py +0 -478
  83. unrealon_driver/src/core/__init__.py +0 -18
  84. unrealon_driver/src/core/exceptions.py +0 -289
  85. unrealon_driver/src/core/parser.py +0 -638
  86. unrealon_driver/src/dto/__init__.py +0 -66
  87. unrealon_driver/src/dto/cli.py +0 -119
  88. unrealon_driver/src/dto/config.py +0 -18
  89. unrealon_driver/src/dto/events.py +0 -237
  90. unrealon_driver/src/dto/execution.py +0 -313
  91. unrealon_driver/src/dto/services.py +0 -311
  92. unrealon_driver/src/execution/__init__.py +0 -23
  93. unrealon_driver/src/execution/daemon_mode.py +0 -317
  94. unrealon_driver/src/execution/interactive_mode.py +0 -88
  95. unrealon_driver/src/execution/modes.py +0 -45
  96. unrealon_driver/src/execution/scheduled_mode.py +0 -209
  97. unrealon_driver/src/execution/test_mode.py +0 -250
  98. unrealon_driver/src/logging/__init__.py +0 -24
  99. unrealon_driver/src/logging/driver_logger.py +0 -512
  100. unrealon_driver/src/services/__init__.py +0 -24
  101. unrealon_driver/src/services/browser_service.py +0 -726
  102. unrealon_driver/src/services/llm/__init__.py +0 -15
  103. unrealon_driver/src/services/llm/browser_llm_service.py +0 -363
  104. unrealon_driver/src/services/llm/llm.py +0 -195
  105. unrealon_driver/src/services/logger_service.py +0 -232
  106. unrealon_driver/src/services/metrics_service.py +0 -185
  107. unrealon_driver/src/services/scheduler_service.py +0 -489
  108. unrealon_driver/src/services/websocket_service.py +0 -362
  109. unrealon_driver/src/utils/__init__.py +0 -16
  110. unrealon_driver/src/utils/service_factory.py +0 -317
  111. unrealon_driver/src/utils/time_formatter.py +0 -338
  112. unrealon_llm/README.md +0 -44
  113. unrealon_llm/__init__.py +0 -26
  114. unrealon_llm/pyproject.toml +0 -154
  115. unrealon_llm/src/__init__.py +0 -228
  116. unrealon_llm/src/cli/__init__.py +0 -0
  117. unrealon_llm/src/core/__init__.py +0 -11
  118. unrealon_llm/src/core/smart_client.py +0 -438
  119. unrealon_llm/src/dto/__init__.py +0 -155
  120. unrealon_llm/src/dto/models/__init__.py +0 -0
  121. unrealon_llm/src/dto/models/config.py +0 -343
  122. unrealon_llm/src/dto/models/core.py +0 -328
  123. unrealon_llm/src/dto/models/enums.py +0 -123
  124. unrealon_llm/src/dto/models/html_analysis.py +0 -345
  125. unrealon_llm/src/dto/models/statistics.py +0 -473
  126. unrealon_llm/src/dto/models/translation.py +0 -383
  127. unrealon_llm/src/dto/models/type_conversion.py +0 -462
  128. unrealon_llm/src/dto/schemas/__init__.py +0 -0
  129. unrealon_llm/src/exceptions.py +0 -392
  130. unrealon_llm/src/llm_config/__init__.py +0 -20
  131. unrealon_llm/src/llm_config/logging_config.py +0 -178
  132. unrealon_llm/src/llm_logging/__init__.py +0 -42
  133. unrealon_llm/src/llm_logging/llm_events.py +0 -107
  134. unrealon_llm/src/llm_logging/llm_logger.py +0 -466
  135. unrealon_llm/src/managers/__init__.py +0 -15
  136. unrealon_llm/src/managers/cache_manager.py +0 -67
  137. unrealon_llm/src/managers/cost_manager.py +0 -107
  138. unrealon_llm/src/managers/request_manager.py +0 -298
  139. unrealon_llm/src/modules/__init__.py +0 -0
  140. unrealon_llm/src/modules/html_processor/__init__.py +0 -25
  141. unrealon_llm/src/modules/html_processor/base_processor.py +0 -415
  142. unrealon_llm/src/modules/html_processor/details_processor.py +0 -85
  143. unrealon_llm/src/modules/html_processor/listing_processor.py +0 -91
  144. unrealon_llm/src/modules/html_processor/models/__init__.py +0 -20
  145. unrealon_llm/src/modules/html_processor/models/processing_models.py +0 -40
  146. unrealon_llm/src/modules/html_processor/models/universal_model.py +0 -56
  147. unrealon_llm/src/modules/html_processor/processor.py +0 -102
  148. unrealon_llm/src/modules/llm/__init__.py +0 -0
  149. unrealon_llm/src/modules/translator/__init__.py +0 -0
  150. unrealon_llm/src/provider.py +0 -116
  151. unrealon_llm/src/utils/__init__.py +0 -95
  152. unrealon_llm/src/utils/common.py +0 -64
  153. unrealon_llm/src/utils/data_extractor.py +0 -188
  154. unrealon_llm/src/utils/html_cleaner.py +0 -767
  155. unrealon_llm/src/utils/language_detector.py +0 -308
  156. unrealon_llm/src/utils/models_cache.py +0 -592
  157. unrealon_llm/src/utils/smart_counter.py +0 -229
  158. unrealon_llm/src/utils/token_counter.py +0 -189
  159. unrealon_sdk/README.md +0 -25
  160. unrealon_sdk/__init__.py +0 -30
  161. unrealon_sdk/pyproject.toml +0 -231
  162. unrealon_sdk/src/__init__.py +0 -150
  163. unrealon_sdk/src/cli/__init__.py +0 -12
  164. unrealon_sdk/src/cli/commands/__init__.py +0 -22
  165. unrealon_sdk/src/cli/commands/benchmark.py +0 -42
  166. unrealon_sdk/src/cli/commands/diagnostics.py +0 -573
  167. unrealon_sdk/src/cli/commands/health.py +0 -46
  168. unrealon_sdk/src/cli/commands/integration.py +0 -498
  169. unrealon_sdk/src/cli/commands/reports.py +0 -43
  170. unrealon_sdk/src/cli/commands/security.py +0 -36
  171. unrealon_sdk/src/cli/commands/server.py +0 -483
  172. unrealon_sdk/src/cli/commands/servers.py +0 -56
  173. unrealon_sdk/src/cli/commands/tests.py +0 -55
  174. unrealon_sdk/src/cli/main.py +0 -126
  175. unrealon_sdk/src/cli/utils/reporter.py +0 -519
  176. unrealon_sdk/src/clients/openapi.yaml +0 -3347
  177. unrealon_sdk/src/clients/python_http/__init__.py +0 -3
  178. unrealon_sdk/src/clients/python_http/api_config.py +0 -228
  179. unrealon_sdk/src/clients/python_http/models/BaseModel.py +0 -12
  180. unrealon_sdk/src/clients/python_http/models/BroadcastDeliveryStats.py +0 -33
  181. unrealon_sdk/src/clients/python_http/models/BroadcastMessage.py +0 -17
  182. unrealon_sdk/src/clients/python_http/models/BroadcastMessageRequest.py +0 -35
  183. unrealon_sdk/src/clients/python_http/models/BroadcastPriority.py +0 -10
  184. unrealon_sdk/src/clients/python_http/models/BroadcastResponse.py +0 -21
  185. unrealon_sdk/src/clients/python_http/models/BroadcastResultResponse.py +0 -33
  186. unrealon_sdk/src/clients/python_http/models/BroadcastTarget.py +0 -11
  187. unrealon_sdk/src/clients/python_http/models/ConnectionStats.py +0 -27
  188. unrealon_sdk/src/clients/python_http/models/ConnectionsResponse.py +0 -21
  189. unrealon_sdk/src/clients/python_http/models/DeveloperMessageResponse.py +0 -23
  190. unrealon_sdk/src/clients/python_http/models/ErrorResponse.py +0 -25
  191. unrealon_sdk/src/clients/python_http/models/HTTPValidationError.py +0 -16
  192. unrealon_sdk/src/clients/python_http/models/HealthResponse.py +0 -23
  193. unrealon_sdk/src/clients/python_http/models/HealthStatus.py +0 -33
  194. unrealon_sdk/src/clients/python_http/models/LogLevel.py +0 -10
  195. unrealon_sdk/src/clients/python_http/models/LoggingRequest.py +0 -27
  196. unrealon_sdk/src/clients/python_http/models/LoggingResponse.py +0 -23
  197. unrealon_sdk/src/clients/python_http/models/MaintenanceMode.py +0 -9
  198. unrealon_sdk/src/clients/python_http/models/MaintenanceModeRequest.py +0 -33
  199. unrealon_sdk/src/clients/python_http/models/MaintenanceStatusResponse.py +0 -39
  200. unrealon_sdk/src/clients/python_http/models/ParserCommandRequest.py +0 -25
  201. unrealon_sdk/src/clients/python_http/models/ParserMessageResponse.py +0 -21
  202. unrealon_sdk/src/clients/python_http/models/ParserRegistrationRequest.py +0 -28
  203. unrealon_sdk/src/clients/python_http/models/ParserRegistrationResponse.py +0 -25
  204. unrealon_sdk/src/clients/python_http/models/ParserType.py +0 -10
  205. unrealon_sdk/src/clients/python_http/models/ProxyBlockRequest.py +0 -19
  206. unrealon_sdk/src/clients/python_http/models/ProxyEndpointResponse.py +0 -20
  207. unrealon_sdk/src/clients/python_http/models/ProxyListResponse.py +0 -19
  208. unrealon_sdk/src/clients/python_http/models/ProxyProvider.py +0 -10
  209. unrealon_sdk/src/clients/python_http/models/ProxyPurchaseRequest.py +0 -25
  210. unrealon_sdk/src/clients/python_http/models/ProxyResponse.py +0 -47
  211. unrealon_sdk/src/clients/python_http/models/ProxyRotationRequest.py +0 -23
  212. unrealon_sdk/src/clients/python_http/models/ProxyStatus.py +0 -10
  213. unrealon_sdk/src/clients/python_http/models/ProxyUsageRequest.py +0 -19
  214. unrealon_sdk/src/clients/python_http/models/ProxyUsageStatsResponse.py +0 -26
  215. unrealon_sdk/src/clients/python_http/models/ServiceRegistrationDto.py +0 -23
  216. unrealon_sdk/src/clients/python_http/models/ServiceStatsResponse.py +0 -31
  217. unrealon_sdk/src/clients/python_http/models/SessionStartRequest.py +0 -23
  218. unrealon_sdk/src/clients/python_http/models/SuccessResponse.py +0 -25
  219. unrealon_sdk/src/clients/python_http/models/SystemNotificationResponse.py +0 -23
  220. unrealon_sdk/src/clients/python_http/models/ValidationError.py +0 -18
  221. unrealon_sdk/src/clients/python_http/models/ValidationErrorResponse.py +0 -21
  222. unrealon_sdk/src/clients/python_http/models/WebSocketMetrics.py +0 -21
  223. unrealon_sdk/src/clients/python_http/models/__init__.py +0 -44
  224. unrealon_sdk/src/clients/python_http/services/None_service.py +0 -35
  225. unrealon_sdk/src/clients/python_http/services/ParserManagement_service.py +0 -190
  226. unrealon_sdk/src/clients/python_http/services/ProxyManagement_service.py +0 -289
  227. unrealon_sdk/src/clients/python_http/services/SocketLogging_service.py +0 -187
  228. unrealon_sdk/src/clients/python_http/services/SystemHealth_service.py +0 -119
  229. unrealon_sdk/src/clients/python_http/services/WebSocketAPI_service.py +0 -198
  230. unrealon_sdk/src/clients/python_http/services/__init__.py +0 -0
  231. unrealon_sdk/src/clients/python_http/services/admin_service.py +0 -125
  232. unrealon_sdk/src/clients/python_http/services/async_None_service.py +0 -35
  233. unrealon_sdk/src/clients/python_http/services/async_ParserManagement_service.py +0 -190
  234. unrealon_sdk/src/clients/python_http/services/async_ProxyManagement_service.py +0 -289
  235. unrealon_sdk/src/clients/python_http/services/async_SocketLogging_service.py +0 -189
  236. unrealon_sdk/src/clients/python_http/services/async_SystemHealth_service.py +0 -123
  237. unrealon_sdk/src/clients/python_http/services/async_WebSocketAPI_service.py +0 -200
  238. unrealon_sdk/src/clients/python_http/services/async_admin_service.py +0 -125
  239. unrealon_sdk/src/clients/python_websocket/__init__.py +0 -28
  240. unrealon_sdk/src/clients/python_websocket/client.py +0 -490
  241. unrealon_sdk/src/clients/python_websocket/events.py +0 -732
  242. unrealon_sdk/src/clients/python_websocket/example.py +0 -136
  243. unrealon_sdk/src/clients/python_websocket/types.py +0 -871
  244. unrealon_sdk/src/core/__init__.py +0 -64
  245. unrealon_sdk/src/core/client.py +0 -556
  246. unrealon_sdk/src/core/config.py +0 -465
  247. unrealon_sdk/src/core/exceptions.py +0 -239
  248. unrealon_sdk/src/core/metadata.py +0 -191
  249. unrealon_sdk/src/core/models.py +0 -142
  250. unrealon_sdk/src/core/types.py +0 -68
  251. unrealon_sdk/src/dto/__init__.py +0 -268
  252. unrealon_sdk/src/dto/authentication.py +0 -108
  253. unrealon_sdk/src/dto/cache.py +0 -208
  254. unrealon_sdk/src/dto/common.py +0 -19
  255. unrealon_sdk/src/dto/concurrency.py +0 -393
  256. unrealon_sdk/src/dto/events.py +0 -108
  257. unrealon_sdk/src/dto/health.py +0 -339
  258. unrealon_sdk/src/dto/load_balancing.py +0 -336
  259. unrealon_sdk/src/dto/logging.py +0 -230
  260. unrealon_sdk/src/dto/performance.py +0 -165
  261. unrealon_sdk/src/dto/rate_limiting.py +0 -295
  262. unrealon_sdk/src/dto/resource_pooling.py +0 -128
  263. unrealon_sdk/src/dto/structured_logging.py +0 -112
  264. unrealon_sdk/src/dto/task_scheduling.py +0 -121
  265. unrealon_sdk/src/dto/websocket.py +0 -55
  266. unrealon_sdk/src/enterprise/__init__.py +0 -59
  267. unrealon_sdk/src/enterprise/authentication.py +0 -401
  268. unrealon_sdk/src/enterprise/cache_manager.py +0 -578
  269. unrealon_sdk/src/enterprise/error_recovery.py +0 -494
  270. unrealon_sdk/src/enterprise/event_system.py +0 -549
  271. unrealon_sdk/src/enterprise/health_monitor.py +0 -747
  272. unrealon_sdk/src/enterprise/load_balancer.py +0 -964
  273. unrealon_sdk/src/enterprise/logging/__init__.py +0 -68
  274. unrealon_sdk/src/enterprise/logging/cleanup.py +0 -156
  275. unrealon_sdk/src/enterprise/logging/development.py +0 -744
  276. unrealon_sdk/src/enterprise/logging/service.py +0 -410
  277. unrealon_sdk/src/enterprise/multithreading_manager.py +0 -853
  278. unrealon_sdk/src/enterprise/performance_monitor.py +0 -539
  279. unrealon_sdk/src/enterprise/proxy_manager.py +0 -696
  280. unrealon_sdk/src/enterprise/rate_limiter.py +0 -652
  281. unrealon_sdk/src/enterprise/resource_pool.py +0 -763
  282. unrealon_sdk/src/enterprise/task_scheduler.py +0 -709
  283. unrealon_sdk/src/internal/__init__.py +0 -10
  284. unrealon_sdk/src/internal/command_router.py +0 -497
  285. unrealon_sdk/src/internal/connection_manager.py +0 -397
  286. unrealon_sdk/src/internal/http_client.py +0 -446
  287. unrealon_sdk/src/internal/websocket_client.py +0 -420
  288. unrealon_sdk/src/provider.py +0 -471
  289. unrealon_sdk/src/utils.py +0 -234
  290. /unrealon_browser/{src/cli → cli}/__init__.py +0 -0
  291. /unrealon_browser/{src/cli → cli}/interactive_mode.py +0 -0
  292. /unrealon_browser/{src/cli → cli}/main.py +0 -0
  293. /unrealon_browser/{src/core → core}/__init__.py +0 -0
  294. /unrealon_browser/{src/dto → dto}/__init__.py +0 -0
  295. /unrealon_browser/{src/dto → dto}/models/config.py +0 -0
  296. /unrealon_browser/{src/dto → dto}/models/core.py +0 -0
  297. /unrealon_browser/{src/dto → dto}/models/dataclasses.py +0 -0
  298. /unrealon_browser/{src/dto → dto}/models/detection.py +0 -0
  299. /unrealon_browser/{src/dto → dto}/models/enums.py +0 -0
  300. /unrealon_browser/{src/dto → dto}/models/statistics.py +0 -0
  301. /unrealon_browser/{src/managers → managers}/__init__.py +0 -0
  302. /unrealon_browser/{src/managers → managers}/stealth.py +0 -0
@@ -1,395 +0,0 @@
1
- """
2
- Logger Bridge - Integration bridge between unrealon_browser and unrealon_sdk loggers
3
- Layer 2.5: Logging Integration - Connects independent browser module with SDK enterprise loggers
4
- """
5
-
6
- from typing import Optional, Any, Dict
7
- from datetime import datetime, timezone
8
-
9
- # Browser DTOs
10
- from unrealon_browser.src.dto import (
11
- BrowserSessionStatus,
12
- BrowserSession,
13
- CaptchaDetectionResult,
14
- # 🔥 StealthLevel removed - STEALTH ALWAYS ON!
15
- )
16
- from unrealon_sdk.src.enterprise.logging.development import get_development_logger
17
- from unrealon_sdk.src.enterprise.logging import (
18
- LoggingService,
19
- StructuredLogger,
20
- LogLevel,
21
- DevelopmentLogger,
22
- SDKEventType,
23
- SDKSeverity,
24
- SDKContext,
25
- )
26
- from unrealon_sdk.src.utils import generate_correlation_id
27
-
28
-
29
- class BrowserLoggerBridge:
30
- """
31
- Bridge between unrealon_browser and unrealon_sdk loggers
32
-
33
- Provides unified logging interface for browser operations while
34
- maintaining compatibility with both standalone and SDK-integrated usage.
35
- """
36
-
37
- def __init__(
38
- self,
39
- session_id: Optional[str] = None,
40
- logging_service: Optional[LoggingService] = None,
41
- development_logger: Optional[DevelopmentLogger] = None,
42
- enable_console: bool = True,
43
- ):
44
- """Initialize logger bridge"""
45
- self.session_id = session_id or generate_correlation_id()
46
- self.enable_console = enable_console
47
-
48
- # SDK loggers (optional)
49
- self.logging_service = logging_service
50
- self.development_logger = development_logger
51
- self.structured_logger: Optional[StructuredLogger] = None
52
-
53
- # Initialize structured logger if logging service is available
54
- if self.logging_service:
55
- self.structured_logger = self.logging_service.get_logger("browser_automation")
56
-
57
- # Statistics
58
- self._events_logged = 0
59
- self._browser_events = {
60
- "browser_initialized": 0,
61
- "navigation_success": 0,
62
- "navigation_failed": 0,
63
- "stealth_applied": 0,
64
- "captcha_detected": 0,
65
- "captcha_solved": 0,
66
- "profile_created": 0,
67
- "cookies_saved": 0,
68
- }
69
-
70
- self._log_debug(
71
- "BROWSER_LOGGER_INITIALIZED",
72
- f"BrowserLoggerBridge initialized for session {self.session_id}",
73
- )
74
-
75
- def _log_console(self, level: str, message: str, **context: Any) -> None:
76
- """Fallback console logging"""
77
- if self.enable_console:
78
- timestamp = datetime.now().strftime("%H:%M:%S")
79
- context_str = f" {context}" if context else ""
80
- print(f"{timestamp} | BROWSER | {level} | {message}{context_str}")
81
-
82
- def _log_debug(self, event_type: str, message: str, **context: Any) -> None:
83
- """Debug level logging with fallbacks"""
84
- self._events_logged += 1
85
-
86
- # SDK Development Logger
87
- if self.development_logger:
88
- try:
89
- sdk_event = getattr(SDKEventType, event_type, SDKEventType.DEBUG_CHECKPOINT)
90
- sdk_context = SDKContext(
91
- layer_name="Browser_Automation",
92
- component_name="BrowserManager",
93
- correlation_id=self.session_id,
94
- )
95
- self.development_logger.log_debug(sdk_event, message, context=sdk_context)
96
- except Exception as e:
97
- self._log_console("DEBUG", f"Development logger error: {e}")
98
-
99
- # Structured Logger
100
- if self.structured_logger:
101
- try:
102
- self.structured_logger.debug(message, **context)
103
- except Exception as e:
104
- self._log_console("DEBUG", f"Structured logger error: {e}")
105
-
106
- # Console fallback
107
- self._log_console("DEBUG", message, **context)
108
-
109
- def _log_info(
110
- self, event_type: str, message: str, success: bool = True, **context: Any
111
- ) -> None:
112
- """Info level logging with fallbacks"""
113
- self._events_logged += 1
114
-
115
- # SDK Development Logger
116
- if self.development_logger:
117
- try:
118
- sdk_event = getattr(SDKEventType, event_type, SDKEventType.COMPONENT_INTEGRATED)
119
- sdk_context = SDKContext(
120
- layer_name="Browser_Automation",
121
- component_name="BrowserManager",
122
- correlation_id=self.session_id,
123
- )
124
- self.development_logger.log_info(
125
- sdk_event, message, context=sdk_context, success=success
126
- )
127
- except Exception as e:
128
- self._log_console("INFO", f"Development logger error: {e}")
129
-
130
- # Structured Logger
131
- if self.structured_logger:
132
- try:
133
- self.structured_logger.info(message, success=success, **context)
134
- except Exception as e:
135
- self._log_console("INFO", f"Structured logger error: {e}")
136
-
137
- # Console fallback
138
- self._log_console("INFO", message, success=success, **context)
139
-
140
- def _log_warning(self, event_type: str, message: str, **context: Any) -> None:
141
- """Warning level logging with fallbacks"""
142
- self._events_logged += 1
143
-
144
- # SDK Development Logger
145
- if self.development_logger:
146
- try:
147
- sdk_event = getattr(
148
- SDKEventType, event_type, SDKEventType.PERFORMANCE_THRESHOLD_EXCEEDED
149
- )
150
- sdk_context = SDKContext(
151
- layer_name="Browser_Automation",
152
- component_name="BrowserManager",
153
- correlation_id=self.session_id,
154
- )
155
- self.development_logger.log_warning(sdk_event, message, context=sdk_context)
156
- except Exception as e:
157
- self._log_console("WARNING", f"Development logger error: {e}")
158
-
159
- # Structured Logger
160
- if self.structured_logger:
161
- try:
162
- self.structured_logger.warning(message, **context)
163
- except Exception as e:
164
- self._log_console("WARNING", f"Structured logger error: {e}")
165
-
166
- # Console fallback
167
- self._log_console("WARNING", message, **context)
168
-
169
- def _log_error(
170
- self, event_type: str, message: str, exception: Optional[Exception] = None, **context: Any
171
- ) -> None:
172
- """Error level logging with fallbacks"""
173
- self._events_logged += 1
174
-
175
- # SDK Development Logger
176
- if self.development_logger:
177
- try:
178
- sdk_event = getattr(SDKEventType, event_type, SDKEventType.COMPONENT_DEPRECATED)
179
- sdk_context = SDKContext(
180
- layer_name="Browser_Automation",
181
- component_name="BrowserManager",
182
- correlation_id=self.session_id,
183
- )
184
- self.development_logger.log_error(
185
- sdk_event, message, context=sdk_context, exception=exception
186
- )
187
- except Exception as e:
188
- self._log_console("ERROR", f"Development logger error: {e}")
189
-
190
- # Structured Logger
191
- if self.structured_logger:
192
- try:
193
- error_context = {**context}
194
- if exception:
195
- error_context["exception_type"] = type(exception).__name__
196
- error_context["exception_message"] = str(exception)
197
- self.structured_logger.error(message, **error_context)
198
- except Exception as e:
199
- self._log_console("ERROR", f"Structured logger error: {e}")
200
-
201
- # Console fallback
202
- error_context = {**context}
203
- if exception:
204
- error_context["exception"] = str(exception)
205
- self._log_console("ERROR", message, **error_context)
206
-
207
- # Browser-specific logging methods
208
- def log_browser_initialized(self, metadata: BrowserSession) -> None:
209
- """Log browser initialization"""
210
- self._browser_events["browser_initialized"] += 1
211
- self._log_info(
212
- "COMPONENT_INTEGRATED",
213
- f"Browser session initialized: {metadata.session_id}",
214
- session_id=metadata.session_id,
215
- parser_name=metadata.parser_name,
216
- browser_type=metadata.browser_type or "unknown",
217
- stealth_level="unknown",
218
- proxy_host=getattr(metadata.proxy, "host", None) if metadata.proxy else None,
219
- proxy_port=getattr(metadata.proxy, "port", None) if metadata.proxy else None,
220
- )
221
-
222
- def log_navigation_success(self, url: str, title: str, duration_ms: float) -> None:
223
- """Log successful navigation"""
224
- self._browser_events["navigation_success"] += 1
225
- self._log_info(
226
- "API_CALL_COMPLETED",
227
- f"Navigation successful: {title}",
228
- url=url,
229
- title=title,
230
- duration_ms=duration_ms,
231
- navigation_type="browser_navigation",
232
- )
233
-
234
- def log_navigation_failed(self, url: str, error: str, duration_ms: float) -> None:
235
- """Log failed navigation"""
236
- self._browser_events["navigation_failed"] += 1
237
- self._log_error(
238
- "API_CALL_FAILED",
239
- f"Navigation failed: {url}",
240
- url=url,
241
- error_message=error,
242
- duration_ms=duration_ms,
243
- navigation_type="browser_navigation",
244
- )
245
-
246
- def log_stealth_applied(self, stealth_level: str, success: bool) -> None:
247
- """Log stealth application - 🔥 STEALTH ALWAYS ON!"""
248
- self._browser_events["stealth_applied"] += 1
249
-
250
- if success:
251
- self._log_info(
252
- "COMPONENT_INTEGRATED",
253
- f"Stealth measures applied: {stealth_level}",
254
- stealth_level=stealth_level,
255
- stealth_success=True,
256
- )
257
- else:
258
- self._log_warning(
259
- "COMPONENT_DEPRECATED",
260
- f"Stealth application failed: {stealth_level}",
261
- stealth_level=stealth_level,
262
- stealth_success=False,
263
- )
264
-
265
- def log_captcha_detected(self, result: CaptchaDetectionResult) -> None:
266
- """Log captcha detection"""
267
- self._browser_events["captcha_detected"] += 1
268
- self._log_warning(
269
- "PERFORMANCE_THRESHOLD_EXCEEDED",
270
- f"Captcha detected: {result.captcha_type.value}",
271
- captcha_type=result.captcha_type.value,
272
- page_url=result.page_url,
273
- proxy_host=result.proxy_host,
274
- proxy_port=result.proxy_port,
275
- detected_at=result.detected_at.isoformat(),
276
- )
277
-
278
- def log_captcha_solved(self, proxy_host: str, proxy_port: int, manual: bool = True) -> None:
279
- """Log captcha resolution"""
280
- self._browser_events["captcha_solved"] += 1
281
- self._log_info(
282
- "COMPONENT_INTEGRATED",
283
- f"Captcha solved for proxy {proxy_host}:{proxy_port}",
284
- proxy_host=proxy_host,
285
- proxy_port=proxy_port,
286
- resolution_method="manual" if manual else "automatic",
287
- cookies_will_be_saved=True,
288
- )
289
-
290
- def log_profile_created(
291
- self, profile_name: str, proxy_info: Optional[Dict[str, Any]] = None
292
- ) -> None:
293
- """Log profile creation"""
294
- self._browser_events["profile_created"] += 1
295
- context = {"profile_name": profile_name}
296
- if proxy_info:
297
- context.update(proxy_info)
298
-
299
- self._log_info("COMPONENT_CREATED", f"Browser profile created: {profile_name}", **context)
300
-
301
- def log_cookies_saved(
302
- self, proxy_host: str, proxy_port: int, cookies_count: int, parser_name: str
303
- ) -> None:
304
- """Log cookie saving"""
305
- self._browser_events["cookies_saved"] += 1
306
- self._log_info(
307
- "DATA_STORED",
308
- f"Cookies saved for {proxy_host}:{proxy_port}",
309
- proxy_host=proxy_host,
310
- proxy_port=proxy_port,
311
- cookies_count=cookies_count,
312
- parser_name=parser_name,
313
- storage_type="proxy_bound",
314
- )
315
-
316
- def log_performance_metric(
317
- self, metric_name: str, value: float, unit: str, threshold: Optional[float] = None
318
- ) -> None:
319
- """Log performance metrics"""
320
- # Use development logger for performance tracking if available
321
- if self.development_logger:
322
- try:
323
- self.development_logger.log_performance_metric(
324
- metric_name=metric_name,
325
- value=value,
326
- unit=unit,
327
- threshold=threshold,
328
- context=SDKContext(
329
- layer_name="Browser_Automation",
330
- component_name="PerformanceMonitor",
331
- correlation_id=self.session_id,
332
- ),
333
- )
334
- except Exception as e:
335
- self._log_console("DEBUG", f"Performance metric error: {e}")
336
- else:
337
- # Fallback logging
338
- exceeded = threshold is not None and value > threshold
339
- level = "WARNING" if exceeded else "DEBUG"
340
- message = f"Performance: {metric_name} = {value} {unit}"
341
- if threshold:
342
- message += f" (threshold: {threshold})"
343
- self._log_console(level, message, metric=metric_name, value=value, unit=unit)
344
-
345
- def get_statistics(self) -> Dict[str, Any]:
346
- """Get logging statistics"""
347
- return {
348
- "total_events_logged": self._events_logged,
349
- "browser_events": self._browser_events.copy(),
350
- "session_id": self.session_id,
351
- "loggers": {
352
- "logging_service": self.logging_service is not None,
353
- "development_logger": self.development_logger is not None,
354
- "structured_logger": self.structured_logger is not None,
355
- "console_enabled": self.enable_console,
356
- },
357
- }
358
-
359
- def print_statistics(self) -> None:
360
- """Print logging statistics"""
361
- stats = self.get_statistics()
362
-
363
- print("\n📊 Browser Logger Bridge Statistics:")
364
- print(f" Total events logged: {stats['total_events_logged']}")
365
- print(f" Session ID: {stats['session_id']}")
366
-
367
- print(" Browser events:")
368
- for event, count in stats["browser_events"].items():
369
- print(f" {event}: {count}")
370
-
371
- print(" Logger availability:")
372
- for logger, available in stats["loggers"].items():
373
- print(f" {logger}: {'✅' if available else '❌'}")
374
-
375
-
376
- # Factory function for easy integration
377
- def create_browser_logger_bridge(
378
- session_id: Optional[str] = None,
379
- enable_console: bool = True,
380
- ) -> BrowserLoggerBridge:
381
- """
382
- Create browser logger bridge with automatic SDK detection
383
-
384
- This function attempts to import and use SDK loggers if available,
385
- but works fine as standalone if SDK is not present.
386
- """
387
- logging_service = None
388
- development_logger = get_development_logger()
389
-
390
- return BrowserLoggerBridge(
391
- session_id=session_id,
392
- logging_service=logging_service,
393
- development_logger=development_logger,
394
- enable_console=enable_console,
395
- )
unrealon_driver/README.md DELETED
@@ -1,204 +0,0 @@
1
- # 🚀 UnrealOn Driver v3.0 - Revolutionary Web Automation
2
-
3
- **Zero-configuration web automation framework with AI-first design and multiple execution modes.**
4
-
5
- ## ✨ Key Features
6
-
7
- - 🎯 **Zero Configuration** - Everything works out of the box
8
- - 🤖 **AI-First Design** - LLM integration as core feature
9
- - 🔌 **Multiple Execution Modes** - test, daemon, scheduled, interactive
10
- - 🌐 **Smart Browser** - Intelligent automation with stealth
11
- - ⏰ **Human-Readable Scheduling** - "30m", "1h", "daily"
12
- - 📊 **Built-in Monitoring** - Enterprise observability
13
-
14
- ## 🚀 Quick Start
15
-
16
- ```python
17
- from unrealon_driver import Parser
18
-
19
- class MyParser(Parser):
20
- async def parse(self):
21
- return await self.browser.extract("https://example.com", ".item")
22
-
23
- # Multiple execution modes
24
- await MyParser().test() # Development
25
- await MyParser().daemon() # Production WebSocket service
26
- await MyParser().schedule(every="30m") # Automated execution
27
- ```
28
-
29
- ## 📦 Installation
30
-
31
- ```bash
32
- # Full installation with all features
33
- pip install unrealon-driver[full]
34
-
35
- # Or minimal installation
36
- pip install unrealon-driver
37
- ```
38
-
39
- ## 🎯 Execution Modes
40
-
41
- ### 🧪 Test Mode - Development & Debugging
42
- ```python
43
- result = await parser.test()
44
- print(result)
45
- ```
46
-
47
- ### 🔌 Daemon Mode - Production WebSocket Service
48
- ```python
49
- await parser.daemon(
50
- server="wss://your-server.com",
51
- api_key="your_key"
52
- )
53
- ```
54
-
55
- ### ⏰ Scheduled Mode - Automated Execution
56
- ```python
57
- # Every 30 minutes
58
- await parser.schedule(every="30m")
59
-
60
- # Daily at 9 AM
61
- await parser.schedule(every="daily", at="09:00")
62
- ```
63
-
64
- ### 🎮 Interactive Mode - Live Development
65
- ```python
66
- await parser.interactive()
67
- ```
68
-
69
- ## 🤖 AI-Powered Extraction
70
-
71
- ```python
72
- class AIParser(Parser):
73
- async def parse(self):
74
- html = await self.browser.get_html("https://shop.com")
75
-
76
- # AI-powered structured extraction
77
- products = await self.llm.extract(html, schema={
78
- "products": [{
79
- "name": "string",
80
- "price": "number",
81
- "rating": "number"
82
- }]
83
- })
84
-
85
- return products
86
- ```
87
-
88
- ## 🌐 Smart Browser Features
89
-
90
- ```python
91
- class BrowserParser(Parser):
92
- async def parse(self):
93
- # Simple extraction
94
- headlines = await self.browser.extract(
95
- "https://news.com",
96
- ".headline",
97
- limit=10
98
- )
99
-
100
- # Structured extraction
101
- products = await self.browser.extract_structured(
102
- "https://shop.com",
103
- schema={
104
- "name": ".product-name",
105
- "price": ".price",
106
- "rating": ".rating"
107
- }
108
- )
109
-
110
- return {"headlines": headlines, "products": products}
111
- ```
112
-
113
- ## 📊 Built-in Monitoring
114
-
115
- All execution modes include comprehensive monitoring:
116
-
117
- - ✅ Performance metrics
118
- - ✅ Error tracking and recovery
119
- - ✅ Health monitoring
120
- - ✅ Cost management (AI features)
121
- - ✅ Automatic logging
122
-
123
- ## 🏗️ Architecture
124
-
125
- UnrealOn Driver v3.0 is built on top of battle-tested components:
126
-
127
- - **🌐 Browser**: [unrealon-browser] - Advanced browser automation
128
- - **🤖 LLM**: [unrealon-llm] - AI-powered extraction
129
- - **🔌 SDK**: [unrealon-sdk] - Enterprise connectivity
130
- - **📝 Logging**: Integrated structured logging
131
- - **📊 Metrics**: Built-in observability
132
-
133
- ## 🔧 Configuration
134
-
135
- ### Zero Configuration (Default)
136
- ```python
137
- # Works immediately without setup
138
- parser = MyParser()
139
- await parser.test()
140
- ```
141
-
142
- ### Environment Variables
143
- ```bash
144
- # Optional configuration
145
- export UNREALON_API_KEY="your_key"
146
- export UNREALON_LLM_PROVIDER="openrouter"
147
- export UNREALON_BROWSER_HEADLESS="false" # For debugging
148
- ```
149
-
150
- ### Custom Configuration
151
- ```python
152
- parser = MyParser(
153
- config={
154
- "browser": {"headless": False},
155
- "llm": {"daily_cost_limit": 10.0},
156
- "logger": {"log_level": "DEBUG"}
157
- }
158
- )
159
- ```
160
-
161
- ## 🧪 Testing
162
-
163
- ```bash
164
- # Run tests
165
- pytest tests/
166
-
167
- # Run specific test
168
- pytest tests/test_parser.py
169
-
170
- # Run with coverage
171
- pytest --cov=src tests/
172
- ```
173
-
174
- ## 📚 Documentation
175
-
176
- Complete documentation is available in the `@docs/` directory:
177
-
178
- - **[Getting Started](@docs/modules/quick-start.md)** - 5-minute quick start
179
- - **[Parser Guide](@docs/modules/parser.md)** - Complete parser documentation
180
- - **[Browser Automation](@docs/modules/browser.md)** - Smart browser features
181
- - **[AI Extraction](@docs/modules/llm.md)** - LLM integration guide
182
- - **[Daemon Mode](@docs/modules/daemon.md)** - Production deployment
183
- - **[Scheduling](@docs/modules/scheduling.md)** - Automated execution
184
- - **[Architecture](@docs/architecture/overview.md)** - Technical overview
185
-
186
- ## 🤝 Contributing
187
-
188
- UnrealOn Driver v3.0 is part of the UnrealOn ecosystem. See the main repository for contribution guidelines.
189
-
190
- ## 📄 License
191
-
192
- MIT License - see LICENSE file for details.
193
-
194
- ## 🚀 What's New in v3.0
195
-
196
- - **Revolutionary Simplicity**: Zero configuration required
197
- - **AI-First Design**: LLM integration as core feature, not add-on
198
- - **Modern Architecture**: Built from scratch for cloud-native deployment
199
- - **Multiple Execution Modes**: Unified API for all use cases
200
- - **Enterprise Ready**: Production monitoring and scaling built-in
201
-
202
- ---
203
-
204
- **Built with ❤️ by the UnrealOn Team**