webpilot-engine 2.0.1__tar.gz → 2.0.2__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 (61) hide show
  1. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/PKG-INFO +1 -1
  2. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/adapters/browser_adapter.py +9 -5
  3. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/adapters/live_session_manager.py +17 -13
  4. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/pyproject.toml +1 -1
  5. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/supervisor/client.py +11 -6
  6. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/supervisor/master_daemon.py +17 -10
  7. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/tests/test_live_session.py +2 -0
  8. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/webpilot_engine.egg-info/PKG-INFO +1 -1
  9. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/README.md +0 -0
  10. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/adapters/__init__.py +0 -0
  11. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/adapters/base.py +0 -0
  12. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/adapters/dom_scripts.py +0 -0
  13. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/adapters/envelope_builder.py +0 -0
  14. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/adapters/upload_adapter.py +0 -0
  15. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/builder.py +0 -0
  16. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/cli.py +0 -0
  17. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/config/__init__.py +0 -0
  18. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/config/settings.py +0 -0
  19. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/constants/__init__.py +0 -0
  20. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/constants/contracts.py +0 -0
  21. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/constants/selectors.py +0 -0
  22. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/constants/timeouts.py +0 -0
  23. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/core/__init__.py +0 -0
  24. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/core/exceptions.py +0 -0
  25. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/core/models.py +0 -0
  26. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/engine.py +0 -0
  27. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/exceptions.py +0 -0
  28. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/mcp_server.py +0 -0
  29. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/models.py +0 -0
  30. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/orchestration/__init__.py +0 -0
  31. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/orchestration/context.py +0 -0
  32. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/orchestration/flow_orchestrator.py +0 -0
  33. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/orchestration/session_coordinator.py +0 -0
  34. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/services/__init__.py +0 -0
  35. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/services/auth_navigation_service.py +0 -0
  36. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/services/field_interaction_service.py +0 -0
  37. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/services/form_filler_service.py +0 -0
  38. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/services/inspection_formatter_service.py +0 -0
  39. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/services/inspection_service.py +0 -0
  40. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/services/reactive_interaction_service.py +0 -0
  41. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/setup.cfg +0 -0
  42. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/supervisor/__init__.py +0 -0
  43. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/supervisor/contracts.py +0 -0
  44. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/supervisor/shell.py +0 -0
  45. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/supervisor/worker_process.py +0 -0
  46. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/tests/test_config_and_builder.py +0 -0
  47. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/tests/test_contracts.py +0 -0
  48. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/tests/test_engine_facade.py +0 -0
  49. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/tests/test_mcp_server.py +0 -0
  50. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/tests/test_orchestration.py +0 -0
  51. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/tests/test_redaction.py +0 -0
  52. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/tests/test_services.py +0 -0
  53. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/tests/test_supervisor.py +0 -0
  54. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/validators/__init__.py +0 -0
  55. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/validators/form_validator.py +0 -0
  56. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/validators/payload_validator.py +0 -0
  57. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/webpilot_engine.egg-info/SOURCES.txt +0 -0
  58. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/webpilot_engine.egg-info/dependency_links.txt +0 -0
  59. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/webpilot_engine.egg-info/entry_points.txt +0 -0
  60. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/webpilot_engine.egg-info/requires.txt +0 -0
  61. {webpilot_engine-2.0.1 → webpilot_engine-2.0.2}/webpilot_engine.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webpilot-engine
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: WebPilot: Enterprise Autonomous Browser Engine, Universal Form Inspector & AI Agent Web Runtime
5
5
  Author: Antigravity Engineering
6
6
  License: MIT
@@ -253,11 +253,15 @@ class BrowserAdapter(BrowserAdapterProtocol):
253
253
  args=["--disable-blink-features=AutomationControlled"],
254
254
  )
255
255
  try:
256
- import subprocess
257
- ps_c = f'(Get-CimInstance Win32_Process | Where-Object {{ $_.ParentProcessId -eq {os.getpid()} }}).ProcessId | Select-Object -First 1'
258
- out = subprocess.check_output(["powershell", "-NoProfile", "-Command", ps_c], text=True).strip()
259
- if out.isdigit():
260
- self.browser_pid = int(out)
256
+ if sys.platform == "win32":
257
+ ps_c = f'(Get-CimInstance Win32_Process | Where-Object {{ $_.ParentProcessId -eq {os.getpid()} }}).ProcessId | Select-Object -First 1'
258
+ out = subprocess.check_output(["powershell", "-NoProfile", "-Command", ps_c], text=True).strip()
259
+ if out.isdigit():
260
+ self.browser_pid = int(out)
261
+ else:
262
+ out = subprocess.check_output(["pgrep", "-P", str(os.getpid())], text=True).strip().split()
263
+ if out and out[0].isdigit():
264
+ self.browser_pid = int(out[0])
261
265
  except Exception:
262
266
  pass
263
267
 
@@ -188,15 +188,16 @@ class LiveSessionManager:
188
188
  proc_pid = cls._launch_wmi_process(cmd_str)
189
189
 
190
190
  if proc_pid is None:
191
- flags = 0
191
+ popen_kwargs: Dict[str, Any] = {
192
+ "stdout": subprocess.DEVNULL,
193
+ "stderr": subprocess.DEVNULL,
194
+ }
192
195
  if sys.platform == "win32":
193
- flags = subprocess.DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP
194
- proc = subprocess.Popen(
195
- args,
196
- stdout=subprocess.DEVNULL,
197
- stderr=subprocess.DEVNULL,
198
- creationflags=flags,
199
- )
196
+ popen_kwargs["creationflags"] = subprocess.DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP
197
+ else:
198
+ popen_kwargs["start_new_session"] = True
199
+
200
+ proc = subprocess.Popen(args, **popen_kwargs)
200
201
  proc_pid = proc.pid
201
202
 
202
203
  # Wait up to 5 seconds for CDP port to become active
@@ -303,16 +304,19 @@ if ($proc.ReturnValue -eq 0) {{
303
304
  if wmi_pid is not None:
304
305
  return
305
306
 
306
- flags = 0
307
+ popen_kwargs: Dict[str, Any] = {
308
+ "stdout": subprocess.DEVNULL,
309
+ "stderr": subprocess.DEVNULL,
310
+ }
307
311
  if sys.platform == "win32":
308
- flags = subprocess.DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP
312
+ popen_kwargs["creationflags"] = subprocess.DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP
313
+ else:
314
+ popen_kwargs["start_new_session"] = True
309
315
 
310
316
  try:
311
317
  subprocess.Popen(
312
318
  [sys.executable, "-m", "adapters.live_session_manager", str(browser_pid), str(port), str(timeout_seconds)],
313
- stdout=subprocess.DEVNULL,
314
- stderr=subprocess.DEVNULL,
315
- creationflags=flags,
319
+ **popen_kwargs,
316
320
  )
317
321
  except Exception:
318
322
  pass
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "webpilot-engine"
7
- version = "2.0.1"
7
+ version = "2.0.2"
8
8
  description = "WebPilot: Enterprise Autonomous Browser Engine, Universal Form Inspector & AI Agent Web Runtime"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -49,15 +49,12 @@ class SupervisorClient:
49
49
  script_path = os.path.join(PROJECT_ROOT, "supervisor", "master_daemon.py")
50
50
  py_exe = sys.executable
51
51
 
52
- # Launch detached via WMI outside any parent terminal Job Object
52
+ # Launch detached via WMI outside any parent terminal Job Object on Windows
53
53
  if sys.platform == "win32":
54
54
  if getattr(sys, "frozen", False):
55
- py_exe = sys.executable
56
55
  cwd = os.path.dirname(py_exe)
57
56
  cmd_line = f'`"{py_exe}`" --run-daemon'
58
57
  else:
59
- script_path = os.path.join(PROJECT_ROOT, "supervisor", "master_daemon.py")
60
- py_exe = sys.executable
61
58
  cwd = PROJECT_ROOT
62
59
  cmd_line = f'`"{py_exe}`" `"{script_path}`"'
63
60
 
@@ -79,12 +76,20 @@ if ($proc.ReturnValue -eq 0) {{
79
76
  timeout=5,
80
77
  )
81
78
  else:
79
+ # POSIX / Linux / macOS
80
+ if getattr(sys, "frozen", False):
81
+ cmd = [py_exe, "--run-daemon"]
82
+ cwd = os.path.dirname(py_exe)
83
+ else:
84
+ cmd = [py_exe, script_path]
85
+ cwd = PROJECT_ROOT
86
+
82
87
  subprocess.Popen(
83
- [sys.executable, script_path],
88
+ cmd,
84
89
  stdout=subprocess.DEVNULL,
85
90
  stderr=subprocess.DEVNULL,
86
91
  start_new_session=True,
87
- cwd=PROJECT_ROOT,
92
+ cwd=cwd,
88
93
  )
89
94
 
90
95
  # Wait up to 4 seconds for supervisor to become active
@@ -87,15 +87,18 @@ class MasterSupervisor:
87
87
  worker_cmd = [sys.executable, "-m", "supervisor.worker_process"]
88
88
  worker_cwd = PROJECT_ROOT
89
89
 
90
- self.worker_process = subprocess.Popen(
91
- worker_cmd,
92
- stdin=subprocess.PIPE,
93
- stdout=subprocess.PIPE,
94
- stderr=subprocess.PIPE,
95
- text=True,
96
- bufsize=1,
97
- cwd=worker_cwd,
98
- )
90
+ popen_kwargs: Dict[str, Any] = {
91
+ "stdin": subprocess.PIPE,
92
+ "stdout": subprocess.PIPE,
93
+ "stderr": subprocess.PIPE,
94
+ "text": True,
95
+ "bufsize": 1,
96
+ "cwd": worker_cwd,
97
+ }
98
+ if sys.platform != "win32":
99
+ popen_kwargs["start_new_session"] = True
100
+
101
+ self.worker_process = subprocess.Popen(worker_cmd, **popen_kwargs)
99
102
  return self.worker_process
100
103
 
101
104
  def execute_action(self, req: SupervisorActionRequest) -> SupervisorActionResponse:
@@ -193,7 +196,11 @@ class MasterSupervisor:
193
196
  stderr=subprocess.DEVNULL,
194
197
  )
195
198
  else:
196
- proc.kill()
199
+ try:
200
+ import signal
201
+ os.killpg(os.getpgid(proc.pid), signal.SIGKILL)
202
+ except Exception:
203
+ proc.kill()
197
204
  except Exception:
198
205
  pass
199
206
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  import os
4
4
  import subprocess
5
+ import sys
5
6
  import time
6
7
  import urllib.request
7
8
  import pytest
@@ -10,6 +11,7 @@ from playwright.sync_api import sync_playwright
10
11
  from adapters.live_session_manager import LiveSessionManager, DEFAULT_CDP_PORT
11
12
 
12
13
 
14
+ @pytest.mark.skipif(sys.platform != "win32", reason="WMI is only available on Windows")
13
15
  def test_wmi_launch():
14
16
  """Verify _launch_wmi_process returns a real PID."""
15
17
  p = sync_playwright().start()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webpilot-engine
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: WebPilot: Enterprise Autonomous Browser Engine, Universal Form Inspector & AI Agent Web Runtime
5
5
  Author: Antigravity Engineering
6
6
  License: MIT
File without changes