unrealon 2.0.4__tar.gz → 2.0.5__tar.gz

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 (136) hide show
  1. {unrealon-2.0.4/unrealon.egg-info → unrealon-2.0.5}/PKG-INFO +1 -1
  2. {unrealon-2.0.4 → unrealon-2.0.5}/pyproject.toml +1 -1
  3. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/cli/browser_cli.py +1 -1
  4. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/cli/interactive_mode.py +1 -1
  5. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/dto/models/config.py +1 -1
  6. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/stealth/manager.pyc +0 -0
  7. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/stealth/scanner_tester.pyc +0 -0
  8. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/__init__.py +17 -5
  9. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/config/environment.py +54 -1
  10. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/config/urls.py +9 -8
  11. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/__init__.py +0 -19
  12. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/communication/websocket_client.py +9 -1
  13. unrealon-2.0.5/unrealon-driver/src/unrealon_driver/driver/core/config.py +175 -0
  14. {unrealon-2.0.4 → unrealon-2.0.5/unrealon.egg-info}/PKG-INFO +1 -1
  15. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon.egg-info/SOURCES.txt +0 -1
  16. unrealon-2.0.4/unrealon-core/src/unrealon_core/models/config.py +0 -47
  17. unrealon-2.0.4/unrealon-driver/src/unrealon_driver/driver/core/config.py +0 -85
  18. {unrealon-2.0.4 → unrealon-2.0.5}/LICENSE +0 -0
  19. {unrealon-2.0.4 → unrealon-2.0.5}/MANIFEST.in +0 -0
  20. {unrealon-2.0.4 → unrealon-2.0.5}/README.md +0 -0
  21. {unrealon-2.0.4 → unrealon-2.0.5}/setup.cfg +0 -0
  22. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/README.md +0 -0
  23. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/__init__.py +0 -0
  24. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/cli/__init__.py +0 -0
  25. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/cli/cookies_cli.py +0 -0
  26. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/cli/main.py +0 -0
  27. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/core/__init__.py +0 -0
  28. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/core/browser_manager.py +0 -0
  29. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/dto/__init__.py +0 -0
  30. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/dto/bot_detection.py +0 -0
  31. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/dto/models/core.py +0 -0
  32. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/dto/models/dataclasses.py +0 -0
  33. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/dto/models/detection.py +0 -0
  34. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/dto/models/enums.py +0 -0
  35. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/dto/models/statistics.py +0 -0
  36. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/managers/__init__.py +0 -0
  37. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/managers/captcha.py +0 -0
  38. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/managers/cookies.py +0 -0
  39. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/managers/logger_bridge.py +0 -0
  40. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/managers/page_wait_manager.py +0 -0
  41. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/managers/profile.py +0 -0
  42. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/stealth/__init__.py +0 -0
  43. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/stealth/bypass_techniques.pyc +0 -0
  44. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/stealth/nodriver_stealth.pyc +0 -0
  45. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/stealth/playwright_stealth.pyc +0 -0
  46. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-browser/src/unrealon_browser/stealth/undetected_chrome.pyc +0 -0
  47. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/config/__init__.py +0 -0
  48. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/enums/__init__.py +0 -0
  49. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/enums/status.py +0 -0
  50. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/enums/types.py +0 -0
  51. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/error_handling/__init__.py +0 -0
  52. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/error_handling/circuit_breaker.py +0 -0
  53. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/error_handling/error_context.py +0 -0
  54. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/error_handling/recovery.py +0 -0
  55. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/error_handling/retry.py +0 -0
  56. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/exceptions/__init__.py +0 -0
  57. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/exceptions/base.py +0 -0
  58. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/exceptions/communication.py +0 -0
  59. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/exceptions/driver.py +0 -0
  60. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/exceptions/proxy.py +0 -0
  61. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/exceptions/task.py +0 -0
  62. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/exceptions/validation.py +0 -0
  63. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/arq_context.py +0 -0
  64. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/arq_responses.py +0 -0
  65. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/base.py +0 -0
  66. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/bridge_stats.py +0 -0
  67. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/communication.py +0 -0
  68. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/connection_stats.py +0 -0
  69. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/driver.py +0 -0
  70. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/driver_details.py +0 -0
  71. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/logging.py +0 -0
  72. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/task.py +0 -0
  73. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/typed_responses.py +0 -0
  74. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket/__init__.py +0 -0
  75. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket/base.py +0 -0
  76. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket/config.py +0 -0
  77. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket/driver.py +0 -0
  78. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket/errors.py +0 -0
  79. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket/heartbeat.py +0 -0
  80. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket/logging.py +0 -0
  81. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket/proxy.py +0 -0
  82. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket/tasks.py +0 -0
  83. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket/utils.py +0 -0
  84. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/models/websocket_session.py +0 -0
  85. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/monitoring/__init__.py +0 -0
  86. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/monitoring/alerts.py +0 -0
  87. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/monitoring/dashboard.py +0 -0
  88. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/monitoring/health_check.py +0 -0
  89. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/monitoring/metrics.py +0 -0
  90. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/utils/__init__.py +0 -0
  91. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/utils/time.py +0 -0
  92. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-core/src/unrealon_core/version.py +0 -0
  93. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/__init__.py +0 -0
  94. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/core_module/__init__.py +0 -0
  95. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/core_module/base.py +0 -0
  96. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/core_module/config.py +0 -0
  97. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/core_module/event_manager.py +0 -0
  98. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/core_module/protocols.py +0 -0
  99. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/core_module/registry.py +0 -0
  100. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/decorators/__init__.py +0 -0
  101. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/decorators/retry.py +0 -0
  102. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/decorators/schedule.py +0 -0
  103. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/decorators/task.py +0 -0
  104. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/decorators/timing.py +0 -0
  105. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/__init__.py +0 -0
  106. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/communication/__init__.py +0 -0
  107. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/communication/session.py +0 -0
  108. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/core/__init__.py +0 -0
  109. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/core/driver.py +0 -0
  110. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/factory/__init__.py +0 -0
  111. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/factory/manager_factory.py +0 -0
  112. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/lifecycle/__init__.py +0 -0
  113. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/lifecycle/daemon.py +0 -0
  114. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/lifecycle/initialization.py +0 -0
  115. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/lifecycle/shutdown.py +0 -0
  116. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/monitoring/__init__.py +0 -0
  117. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/monitoring/health.py +0 -0
  118. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/utilities/__init__.py +0 -0
  119. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/utilities/logging.py +0 -0
  120. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/driver/utilities/serialization.py +0 -0
  121. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/managers/__init__.py +0 -0
  122. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/managers/base.py +0 -0
  123. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/managers/browser.py +0 -0
  124. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/managers/cache.py +0 -0
  125. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/managers/http.py +0 -0
  126. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/managers/logger.py +0 -0
  127. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/managers/proxy.py +0 -0
  128. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/managers/registry.py +0 -0
  129. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/managers/threading.py +0 -0
  130. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/managers/update.py +0 -0
  131. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/utils/__init__.py +0 -0
  132. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon-driver/src/unrealon_driver/utils/time.py +0 -0
  133. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon.egg-info/dependency_links.txt +0 -0
  134. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon.egg-info/entry_points.txt +0 -0
  135. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon.egg-info/requires.txt +0 -0
  136. {unrealon-2.0.4 → unrealon-2.0.5}/unrealon.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unrealon
3
- Version: 2.0.4
3
+ Version: 2.0.5
4
4
  Summary: Enterprise-grade web scraping platform with AI-powered automation and real-time orchestration capabilities
5
5
  Author-email: UnrealOn Team <team@unrealon.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "unrealon"
7
- version = "2.0.4"
7
+ version = "2.0.5"
8
8
  description = "Enterprise-grade web scraping platform with AI-powered automation and real-time orchestration capabilities"
9
9
  authors = [
10
10
  {name = "UnrealOn Team", email = "team@unrealon.com"}
@@ -16,7 +16,7 @@ from rich.table import Table
16
16
  from unrealon_browser.core.browser_manager import BrowserManager
17
17
  from unrealon_browser.dto.models.config import BrowserConfig, BrowserType, BrowserMode
18
18
 
19
- from unrealon_core.config import get_url_config
19
+ from unrealon_core.config.urls import get_url_config
20
20
 
21
21
  console = Console()
22
22
 
@@ -11,7 +11,7 @@ from rich.panel import Panel
11
11
  from rich.table import Table
12
12
  from typing import Dict, Any
13
13
 
14
- from unrealon_core.config import get_url_config
14
+ from unrealon_core.config.urls import get_url_config
15
15
 
16
16
  console = Console()
17
17
 
@@ -8,7 +8,7 @@ from typing import Optional
8
8
  from pydantic import BaseModel, Field, ConfigDict
9
9
  from .enums import BrowserType, BrowserMode
10
10
 
11
- from unrealon_core.config import get_url_config
11
+ from unrealon_core.config.urls import get_url_config
12
12
 
13
13
 
14
14
  def _get_default_stealth_url() -> str:
@@ -76,9 +76,19 @@ from .monitoring import (
76
76
  )
77
77
 
78
78
  # Configuration system
79
- from .config import (
80
- EnvironmentConfig, URLConfig,
81
- get_environment_config, get_url_config
79
+ from .config.environment import (
80
+ EnvironmentConfig, Environment,
81
+ get_environment_config, set_environment_config
82
+ )
83
+ from .config.urls import (
84
+ URLConfig,
85
+ get_url_config
86
+ )
87
+ from .models.websocket.config import (
88
+ DriverConfiguration,
89
+ LoggingConfiguration,
90
+ TaskConfiguration,
91
+ ProxyConfiguration
82
92
  )
83
93
 
84
94
  __all__ = [
@@ -155,6 +165,8 @@ __all__ = [
155
165
  "MonitoringDashboard", "get_system_overview",
156
166
 
157
167
  # Configuration system
158
- "EnvironmentConfig", "URLConfig",
159
- "get_environment_config", "get_url_config",
168
+ "EnvironmentConfig", "Environment", "URLConfig",
169
+ "get_environment_config", "set_environment_config", "get_url_config",
170
+ "DriverConfiguration", "LoggingConfiguration",
171
+ "TaskConfiguration", "ProxyConfiguration",
160
172
  ]
@@ -18,7 +18,7 @@ class Environment(str, Enum):
18
18
 
19
19
 
20
20
  class EnvironmentConfig(BaseModel):
21
- """Environment configuration settings."""
21
+ """Environment configuration settings with all system URLs and settings."""
22
22
 
23
23
  model_config = ConfigDict(
24
24
  # Add any specific config here if needed
@@ -39,6 +39,17 @@ class EnvironmentConfig(BaseModel):
39
39
  description="Logging level"
40
40
  )
41
41
 
42
+ # System URLs - environment-aware
43
+ redis_url: str = Field(
44
+ default_factory=lambda: os.getenv("REDIS_URL", "redis://localhost:6379/0"),
45
+ description="Redis connection URL"
46
+ )
47
+
48
+ max_workers: int = Field(
49
+ default_factory=lambda: int(os.getenv("MAX_WORKERS", "10")),
50
+ description="Maximum number of workers"
51
+ )
52
+
42
53
  @classmethod
43
54
  def from_env(cls) -> "EnvironmentConfig":
44
55
  """Create config from environment variables."""
@@ -76,6 +87,48 @@ class EnvironmentConfig(BaseModel):
76
87
  def is_testing(self) -> bool:
77
88
  """Check if running in testing mode."""
78
89
  return self.environment == Environment.TESTING
90
+
91
+ @property
92
+ def websocket_url(self) -> str:
93
+ """Get WebSocket URL based on environment."""
94
+ # Check explicit env var first
95
+ if ws_url := os.getenv("WEBSOCKET_URL"):
96
+ return ws_url
97
+
98
+ if self.is_production:
99
+ return "wss://ws.unrealon.com/ws"
100
+ elif self.is_development:
101
+ return "ws://localhost:8001/ws" # RPC server port
102
+ else: # testing
103
+ return "ws://localhost:8001/ws"
104
+
105
+ @property
106
+ def api_url(self) -> str:
107
+ """Get API URL based on environment."""
108
+ # Check explicit env var first
109
+ if api_url := os.getenv("API_URL"):
110
+ return api_url
111
+
112
+ if self.is_production:
113
+ return "https://api-m.unrealon.com"
114
+ elif self.is_development:
115
+ return "http://localhost:8002" # Backend server port
116
+ else: # testing
117
+ return "http://localhost:8002"
118
+
119
+ @property
120
+ def django_api_url(self) -> str:
121
+ """Get Django API URL based on environment."""
122
+ # Check explicit env var first
123
+ if api_url := os.getenv("DJANGO_API_URL"):
124
+ return api_url
125
+
126
+ if self.is_production:
127
+ return "https://api.unrealon.com"
128
+ elif self.is_development:
129
+ return "http://localhost:8000" # Django server port
130
+ else: # testing
131
+ return "http://localhost:8000"
79
132
 
80
133
 
81
134
  # Global config instance
@@ -18,6 +18,7 @@ class URLConfig(BaseModel):
18
18
 
19
19
  # Scanner/Detection URLs
20
20
  scanner_url: str = Field(
21
+ default="https://cloud.unrealon.com/scanner",
21
22
  description="URL for browser detection and stealth testing"
22
23
  )
23
24
 
@@ -39,19 +40,19 @@ class URLConfig(BaseModel):
39
40
 
40
41
  if environment == Environment.PRODUCTION:
41
42
  return cls(
42
- scanner_url="https://cloud.unrealon.com/scanner",
43
+ # scanner_url="https://cloud.unrealon.com/scanner",
43
44
  cloud_base_url="https://cloud.unrealon.com",
44
45
  api_base_url="https://api.unrealon.com"
45
46
  )
46
- elif environment == Environment.TESTING:
47
- return cls(
48
- scanner_url="https://staging.unrealon.com/scanner",
49
- cloud_base_url="https://staging.unrealon.com",
50
- api_base_url="https://api-staging.unrealon.com"
51
- )
47
+ # elif environment == Environment.TESTING:
48
+ # return cls(
49
+ # scanner_url="https://staging.unrealon.com/scanner",
50
+ # cloud_base_url="https://staging.unrealon.com",
51
+ # api_base_url="https://api-staging.unrealon.com"
52
+ # )
52
53
  else: # Development
53
54
  return cls(
54
- scanner_url="http://localhost:3000/scanner",
55
+ # scanner_url="http://localhost:3000/scanner",
55
56
  cloud_base_url="http://localhost:3000",
56
57
  api_base_url="http://localhost:8000"
57
58
  )
@@ -46,16 +46,6 @@ from .logging import (
46
46
  LogMetrics
47
47
  )
48
48
 
49
- from .config import (
50
- SystemConfig,
51
- HttpConfig,
52
- ProxyConfig,
53
- BrowserConfig,
54
- LoggingConfig,
55
- CacheConfig,
56
- ThreadConfig
57
- )
58
-
59
49
  __all__ = [
60
50
  # Base models
61
51
  "UnrealOnBaseModel",
@@ -86,13 +76,4 @@ __all__ = [
86
76
  "LogEntry",
87
77
  "LogQuery",
88
78
  "LogMetrics",
89
-
90
- # Configuration models
91
- "SystemConfig",
92
- "HttpConfig",
93
- "ProxyConfig",
94
- "BrowserConfig",
95
- "LoggingConfig",
96
- "CacheConfig",
97
- "ThreadConfig",
98
79
  ]
@@ -9,7 +9,15 @@ from typing import Optional, Callable, List
9
9
  from collections import deque
10
10
 
11
11
  import websockets
12
- from websockets.asyncio.client import ClientConnection
12
+ try:
13
+ from websockets.asyncio.client import ClientConnection
14
+ except ImportError:
15
+ # Fallback for older websockets versions
16
+ try:
17
+ from websockets.client import WebSocketClientProtocol as ClientConnection
18
+ except ImportError:
19
+ # Ultimate fallback
20
+ ClientConnection = None
13
21
 
14
22
  from unrealon_core.models.websocket import (
15
23
  DriverRegistrationMessage,
@@ -0,0 +1,175 @@
1
+ """
2
+ Clean driver configuration without hardcoded values.
3
+ """
4
+
5
+ import os
6
+ from enum import Enum
7
+ from typing import Optional
8
+ from pydantic import BaseModel, Field, computed_field
9
+
10
+ try:
11
+ from unrealon_core.config.environment import get_environment_config
12
+ UNREALON_CORE_AVAILABLE = True
13
+ except ImportError:
14
+ UNREALON_CORE_AVAILABLE = False
15
+
16
+
17
+ class DriverMode(str, Enum):
18
+ """Driver operation modes."""
19
+ STANDALONE = "standalone"
20
+ DAEMON = "daemon"
21
+
22
+
23
+ class DriverConfig(BaseModel):
24
+ """
25
+ Clean driver configuration.
26
+ No hardcoded presets - user configures everything explicitly.
27
+ """
28
+
29
+ # Basic settings
30
+ name: str = Field(..., description="Driver name")
31
+ mode: DriverMode = Field(default=DriverMode.STANDALONE, description="Operation mode")
32
+
33
+ # WebSocket connection (auto-detected)
34
+ websocket_url: Optional[str] = Field(default=None, description="Manual WebSocket URL override")
35
+ websocket_timeout: int = Field(default=30, description="WebSocket timeout seconds")
36
+
37
+ @computed_field
38
+ @property
39
+ def effective_websocket_url(self) -> Optional[str]:
40
+ """
41
+ Auto-detect WebSocket URL from multiple sources.
42
+
43
+ Priority:
44
+ 1. Explicit websocket_url field
45
+ 2. Environment variables (UNREALON_WEBSOCKET_URL, UNREALON_WS_URL, WS_URL)
46
+ 3. UnrealOn core environment config (if available)
47
+ 4. No default - return None if nothing configured
48
+ """
49
+ # 1. Explicit override
50
+ if self.websocket_url:
51
+ return self.websocket_url
52
+
53
+ # 2. Environment variables
54
+ env_url = (
55
+ os.getenv('UNREALON_WEBSOCKET_URL') or
56
+ os.getenv('UNREALON_WS_URL') or
57
+ os.getenv('WS_URL')
58
+ )
59
+ if env_url:
60
+ return env_url
61
+
62
+ # 3. Try unrealon_core environment config
63
+ if UNREALON_CORE_AVAILABLE:
64
+ try:
65
+ env_config = get_environment_config()
66
+ return env_config.websocket_url
67
+ except Exception:
68
+ pass # Fallback gracefully if core config fails
69
+
70
+ # 4. No default - return None if nothing is configured
71
+ return None
72
+
73
+ # Logging
74
+ log_level: str = Field(default="INFO", description="Logging level")
75
+ log_file: Optional[str] = Field(default=None, description="Log file path")
76
+
77
+ # HTTP settings
78
+ http_timeout: int = Field(default=30, description="HTTP timeout seconds")
79
+ max_retries: int = Field(default=3, description="Max HTTP retries")
80
+
81
+ # Browser settings
82
+ browser_headless: bool = Field(default=True, description="Run browser headless")
83
+ browser_timeout: int = Field(default=30, description="Browser timeout seconds")
84
+
85
+ # Proxy settings
86
+ proxy_enabled: bool = Field(default=False, description="Enable proxy rotation")
87
+ proxy_rotation_interval: int = Field(default=300, description="Proxy rotation seconds")
88
+
89
+ # Cache settings
90
+ cache_enabled: bool = Field(default=True, description="Enable response caching")
91
+ cache_ttl: int = Field(default=3600, description="Cache TTL seconds")
92
+
93
+ # Threading
94
+ max_workers: int = Field(default=4, description="Max thread workers")
95
+
96
+ # Performance
97
+ batch_size: int = Field(default=10, description="Batch processing size")
98
+
99
+ model_config = {"extra": "forbid"}
100
+
101
+ @classmethod
102
+ def for_development(cls, name: str, **kwargs) -> "DriverConfig":
103
+ """
104
+ Create development configuration with sensible defaults.
105
+
106
+ Args:
107
+ name: Driver name
108
+ **kwargs: Additional configuration overrides
109
+ """
110
+ defaults = {
111
+ "name": name,
112
+ "mode": DriverMode.STANDALONE,
113
+ "log_level": "DEBUG",
114
+ "browser_headless": False,
115
+ "proxy_enabled": False,
116
+ "cache_enabled": True,
117
+ "max_workers": 2,
118
+ }
119
+ defaults.update(kwargs)
120
+ return cls(**defaults)
121
+
122
+ @classmethod
123
+ def for_production(cls, name: str, **kwargs) -> "DriverConfig":
124
+ """
125
+ Create production configuration with performance and reliability defaults.
126
+
127
+ Args:
128
+ name: Driver name
129
+ **kwargs: Additional configuration overrides
130
+ """
131
+ defaults = {
132
+ "name": name,
133
+ "mode": DriverMode.DAEMON,
134
+ "log_level": "INFO",
135
+ "browser_headless": True,
136
+ "proxy_enabled": True,
137
+ "cache_enabled": True,
138
+ "max_workers": 4,
139
+ "max_retries": 5,
140
+ "http_timeout": 60,
141
+ "browser_timeout": 60,
142
+ }
143
+ defaults.update(kwargs)
144
+ return cls(**defaults)
145
+
146
+ @classmethod
147
+ def auto_detect(cls, name: str, **kwargs) -> "DriverConfig":
148
+ """
149
+ Auto-detect environment and create appropriate configuration.
150
+
151
+ Uses UNREALON_ENV environment variable or unrealon_core config to determine environment.
152
+
153
+ Args:
154
+ name: Driver name
155
+ **kwargs: Additional configuration overrides
156
+ """
157
+ # Try to detect environment
158
+ env_name = os.getenv("UNREALON_ENV", "development").lower()
159
+
160
+ # Try unrealon_core if available
161
+ if UNREALON_CORE_AVAILABLE:
162
+ try:
163
+ env_config = get_environment_config()
164
+ if env_config.is_production:
165
+ return cls.for_production(name, **kwargs)
166
+ elif env_config.is_development:
167
+ return cls.for_development(name, **kwargs)
168
+ except Exception:
169
+ pass # Fallback to env variable
170
+
171
+ # Fallback to environment variable
172
+ if env_name in ("prod", "production"):
173
+ return cls.for_production(name, **kwargs)
174
+ else:
175
+ return cls.for_development(name, **kwargs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unrealon
3
- Version: 2.0.4
3
+ Version: 2.0.5
4
4
  Summary: Enterprise-grade web scraping platform with AI-powered automation and real-time orchestration capabilities
5
5
  Author-email: UnrealOn Team <team@unrealon.com>
6
6
  License: MIT
@@ -58,7 +58,6 @@ unrealon-core/src/unrealon_core/models/arq_responses.py
58
58
  unrealon-core/src/unrealon_core/models/base.py
59
59
  unrealon-core/src/unrealon_core/models/bridge_stats.py
60
60
  unrealon-core/src/unrealon_core/models/communication.py
61
- unrealon-core/src/unrealon_core/models/config.py
62
61
  unrealon-core/src/unrealon_core/models/connection_stats.py
63
62
  unrealon-core/src/unrealon_core/models/driver.py
64
63
  unrealon-core/src/unrealon_core/models/driver_details.py
@@ -1,47 +0,0 @@
1
- """
2
- Config models - Phase 2 update.
3
-
4
- Import from strictly typed websocket models to avoid duplication.
5
- Following critical requirements - no raw Dict[str, Any].
6
- """
7
-
8
- # Import strictly typed models from websocket package
9
- from .websocket.config import (
10
- DriverConfiguration,
11
- LoggingConfiguration,
12
- TaskConfiguration,
13
- ProxyConfiguration
14
- )
15
- from .base import ConfigBaseModel
16
-
17
- # System config that doesn't exist in websocket models yet
18
- class SystemConfig(ConfigBaseModel):
19
- """System-wide configuration."""
20
-
21
- redis_url: str = "redis://localhost:6379/0"
22
- websocket_url: str = "ws://localhost:8000/ws"
23
- max_workers: int = 10
24
- debug: bool = False
25
-
26
- # Legacy compatibility - map to new typed models
27
- HttpConfig = TaskConfiguration # HTTP settings are part of task config
28
- ProxyConfig = ProxyConfiguration
29
- LoggingConfig = LoggingConfiguration
30
- BrowserConfig = TaskConfiguration # Browser settings are part of task config
31
- CacheConfig = SystemConfig # Cache settings are system-wide
32
- ThreadConfig = TaskConfiguration # Thread settings are part of task config
33
-
34
- __all__ = [
35
- 'DriverConfiguration',
36
- 'LoggingConfiguration',
37
- 'TaskConfiguration',
38
- 'ProxyConfiguration',
39
- 'SystemConfig',
40
- # Legacy names
41
- 'HttpConfig',
42
- 'ProxyConfig',
43
- 'LoggingConfig',
44
- 'BrowserConfig',
45
- 'CacheConfig',
46
- 'ThreadConfig'
47
- ]
@@ -1,85 +0,0 @@
1
- """
2
- Clean driver configuration without hardcoded values.
3
- """
4
-
5
- import os
6
- from enum import Enum
7
- from typing import Optional
8
- from pydantic import BaseModel, Field, computed_field
9
-
10
-
11
- class DriverMode(str, Enum):
12
- """Driver operation modes."""
13
- STANDALONE = "standalone"
14
- DAEMON = "daemon"
15
-
16
-
17
- class DriverConfig(BaseModel):
18
- """
19
- Clean driver configuration.
20
- No hardcoded presets - user configures everything explicitly.
21
- """
22
-
23
- # Basic settings
24
- name: str = Field(..., description="Driver name")
25
- mode: DriverMode = Field(default=DriverMode.STANDALONE, description="Operation mode")
26
-
27
- # WebSocket connection (auto-detected)
28
- websocket_url: Optional[str] = Field(default=None, description="Manual WebSocket URL override")
29
- websocket_timeout: int = Field(default=30, description="WebSocket timeout seconds")
30
-
31
- @computed_field
32
- @property
33
- def effective_websocket_url(self) -> Optional[str]:
34
- """
35
- Auto-detect WebSocket URL from multiple sources.
36
-
37
- Priority:
38
- 1. Explicit websocket_url field
39
- 2. Environment variable UNREALON_WEBSOCKET_URL
40
- 3. Environment variable UNREALON_WS_URL
41
- 4. Default localhost for development
42
- """
43
- # 1. Explicit override
44
- if self.websocket_url:
45
- return self.websocket_url
46
-
47
- # 2. Environment variables
48
- env_url = (
49
- os.getenv('UNREALON_WEBSOCKET_URL') or
50
- os.getenv('UNREALON_WS_URL') or
51
- os.getenv('WS_URL')
52
- )
53
- if env_url:
54
- return env_url
55
-
56
- # 3. No default - return None if nothing is configured
57
- return None
58
-
59
- # Logging
60
- log_level: str = Field(default="INFO", description="Logging level")
61
- log_file: Optional[str] = Field(default=None, description="Log file path")
62
-
63
- # HTTP settings
64
- http_timeout: int = Field(default=30, description="HTTP timeout seconds")
65
- max_retries: int = Field(default=3, description="Max HTTP retries")
66
-
67
- # Browser settings
68
- browser_headless: bool = Field(default=True, description="Run browser headless")
69
- browser_timeout: int = Field(default=30, description="Browser timeout seconds")
70
-
71
- # Proxy settings
72
- proxy_enabled: bool = Field(default=False, description="Enable proxy rotation")
73
- proxy_rotation_interval: int = Field(default=300, description="Proxy rotation seconds")
74
-
75
- # Cache settings
76
- cache_enabled: bool = Field(default=True, description="Enable response caching")
77
- cache_ttl: int = Field(default=3600, description="Cache TTL seconds")
78
-
79
- # Threading
80
- max_workers: int = Field(default=4, description="Max thread workers")
81
-
82
- # Performance
83
- batch_size: int = Field(default=10, description="Batch processing size")
84
-
85
- model_config = {"extra": "forbid"}
File without changes
File without changes
File without changes
File without changes