webpilot-engine 2.0.0__tar.gz → 2.0.1__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.
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/PKG-INFO +1 -1
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/adapters/browser_adapter.py +39 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/cli.py +41 -8
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/pyproject.toml +1 -1
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/webpilot_engine.egg-info/PKG-INFO +1 -1
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/README.md +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/adapters/__init__.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/adapters/base.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/adapters/dom_scripts.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/adapters/envelope_builder.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/adapters/live_session_manager.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/adapters/upload_adapter.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/builder.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/config/__init__.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/config/settings.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/constants/__init__.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/constants/contracts.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/constants/selectors.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/constants/timeouts.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/core/__init__.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/core/exceptions.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/core/models.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/engine.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/exceptions.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/mcp_server.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/models.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/orchestration/__init__.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/orchestration/context.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/orchestration/flow_orchestrator.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/orchestration/session_coordinator.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/services/__init__.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/services/auth_navigation_service.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/services/field_interaction_service.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/services/form_filler_service.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/services/inspection_formatter_service.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/services/inspection_service.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/services/reactive_interaction_service.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/setup.cfg +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/supervisor/__init__.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/supervisor/client.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/supervisor/contracts.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/supervisor/master_daemon.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/supervisor/shell.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/supervisor/worker_process.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/tests/test_config_and_builder.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/tests/test_contracts.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/tests/test_engine_facade.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/tests/test_live_session.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/tests/test_mcp_server.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/tests/test_orchestration.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/tests/test_redaction.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/tests/test_services.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/tests/test_supervisor.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/validators/__init__.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/validators/form_validator.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/validators/payload_validator.py +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/webpilot_engine.egg-info/SOURCES.txt +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/webpilot_engine.egg-info/dependency_links.txt +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/webpilot_engine.egg-info/entry_points.txt +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/webpilot_engine.egg-info/requires.txt +0 -0
- {webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/webpilot_engine.egg-info/top_level.txt +0 -0
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
+
import subprocess
|
|
6
7
|
import sys
|
|
7
8
|
from typing import Any, Dict, List, Optional
|
|
8
9
|
from playwright.sync_api import sync_playwright, Browser, BrowserContext, Page, Playwright
|
|
@@ -135,6 +136,43 @@ class BrowserAdapter(BrowserAdapterProtocol):
|
|
|
135
136
|
else:
|
|
136
137
|
raise IndexError(f"Tab index #{index} out of range (Total open tabs: {len(pages)})")
|
|
137
138
|
|
|
139
|
+
def _ensure_browser_binaries(self) -> None:
|
|
140
|
+
"""Verifies Chromium is installed; if not, automatically downloads it or shows a clear error."""
|
|
141
|
+
needs_install = False
|
|
142
|
+
try:
|
|
143
|
+
exec_path = self._pw.chromium.executable_path
|
|
144
|
+
if not exec_path or not os.path.exists(exec_path):
|
|
145
|
+
needs_install = True
|
|
146
|
+
except Exception:
|
|
147
|
+
needs_install = True
|
|
148
|
+
|
|
149
|
+
if needs_install:
|
|
150
|
+
print("\n" + "═" * 70)
|
|
151
|
+
print(" 🚀 WEBPILOT | INITIAL BROWSER SETUP")
|
|
152
|
+
print(" [*] Playwright Chromium binaries not found on this system.")
|
|
153
|
+
print(" [*] Automatically downloading Chromium browser (one-time setup)...")
|
|
154
|
+
print("═" * 70)
|
|
155
|
+
try:
|
|
156
|
+
cmd = [sys.executable, "-m", "playwright", "install", "chromium"]
|
|
157
|
+
subprocess.run(cmd, check=True)
|
|
158
|
+
print("[✓] Chromium installed successfully!")
|
|
159
|
+
except Exception as exc:
|
|
160
|
+
err_banner = (
|
|
161
|
+
"\n" + "═" * 70 + "\n"
|
|
162
|
+
" ❌ WEBPILOT ERROR: CHROMIUM BROWSER NOT INSTALLED\n"
|
|
163
|
+
" " + "═" * 35 + "\n"
|
|
164
|
+
" WebPilot requires Chromium to operate websites.\n"
|
|
165
|
+
" Automatic installation failed (offline or network restriction).\n\n"
|
|
166
|
+
" Please run the following command manually to install the browser:\n\n"
|
|
167
|
+
" playwright install chromium\n"
|
|
168
|
+
" or\n"
|
|
169
|
+
" wp install\n\n"
|
|
170
|
+
f" Details: {exc}\n"
|
|
171
|
+
"═" * 70 + "\n"
|
|
172
|
+
)
|
|
173
|
+
print(err_banner, file=sys.stderr)
|
|
174
|
+
raise RuntimeError("Chromium browser is not installed. Please run: wp install") from None
|
|
175
|
+
|
|
138
176
|
def start(self, cookies_path: Optional[str] = None) -> None:
|
|
139
177
|
"""Starts browser context or connects to existing persistent live session."""
|
|
140
178
|
if self.close_session:
|
|
@@ -146,6 +184,7 @@ class BrowserAdapter(BrowserAdapterProtocol):
|
|
|
146
184
|
return
|
|
147
185
|
|
|
148
186
|
self._pw = sync_playwright().start()
|
|
187
|
+
self._ensure_browser_binaries()
|
|
149
188
|
|
|
150
189
|
existing_session = LiveSessionManager.load_session_state()
|
|
151
190
|
should_use_persistent = self.keep_alive or (existing_session is not None)
|
|
@@ -326,15 +326,48 @@ def main():
|
|
|
326
326
|
p_service.add_argument("--host", default="127.0.0.1", help="Supervisor host address")
|
|
327
327
|
p_service.add_argument("--port", type=int, default=9333, help="Supervisor port")
|
|
328
328
|
|
|
329
|
+
# 5. Browser Binaries Installation Subcommand
|
|
330
|
+
p_install = subparsers.add_parser("install", help="Download and configure required Playwright Chromium browser")
|
|
331
|
+
p_install.add_argument("--all", action="store_true", help="Download all browsers (Chromium, Firefox, WebKit)")
|
|
332
|
+
|
|
329
333
|
args = parser.parse_args()
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
334
|
+
try:
|
|
335
|
+
if args.command == "inspect":
|
|
336
|
+
inspect_cmd(args)
|
|
337
|
+
elif args.command == "apply":
|
|
338
|
+
apply_cmd(args)
|
|
339
|
+
elif args.command == "shell":
|
|
340
|
+
shell_cmd(args)
|
|
341
|
+
elif args.command == "service":
|
|
342
|
+
service_cmd(args)
|
|
343
|
+
elif args.command == "install":
|
|
344
|
+
install_cmd(args)
|
|
345
|
+
except KeyboardInterrupt:
|
|
346
|
+
print("\n[!] Operation cancelled by user.")
|
|
347
|
+
sys.exit(130)
|
|
348
|
+
except Exception as exc:
|
|
349
|
+
print(f"\n[!] Error: {exc}", file=sys.stderr)
|
|
350
|
+
sys.exit(1)
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
def install_cmd(args: argparse.Namespace) -> None:
|
|
354
|
+
"""Installs required Playwright browser binaries."""
|
|
355
|
+
import subprocess
|
|
356
|
+
print("\n" + "═" * 70)
|
|
357
|
+
print(" 🚀 WEBPILOT | BROWSER BINARY INSTALLER")
|
|
358
|
+
print("═" * 70)
|
|
359
|
+
target = "all" if getattr(args, "all", False) else "chromium"
|
|
360
|
+
cmd = [sys.executable, "-m", "playwright", "install"]
|
|
361
|
+
if target != "all":
|
|
362
|
+
cmd.append("chromium")
|
|
363
|
+
print(f"[*] Downloading and configuring Playwright {target} browser binaries...")
|
|
364
|
+
try:
|
|
365
|
+
subprocess.run(cmd, check=True)
|
|
366
|
+
print("\n[✓] Browser binaries downloaded and configured successfully!")
|
|
367
|
+
except Exception as exc:
|
|
368
|
+
print(f"\n[!] Failed to install browser binaries: {exc}", file=sys.stderr)
|
|
369
|
+
print("Please check your internet connection or run 'playwright install chromium' manually.", file=sys.stderr)
|
|
370
|
+
sys.exit(1)
|
|
338
371
|
|
|
339
372
|
|
|
340
373
|
if __name__ == "__main__":
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "webpilot-engine"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.1"
|
|
8
8
|
description = "WebPilot: Enterprise Autonomous Browser Engine, Universal Form Inspector & AI Agent Web Runtime"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{webpilot_engine-2.0.0 → webpilot_engine-2.0.1}/webpilot_engine.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|