webpilot-engine 2.0.0__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.0/PKG-INFO +299 -0
  2. webpilot_engine-2.0.0/README.md +267 -0
  3. webpilot_engine-2.0.0/adapters/__init__.py +14 -0
  4. webpilot_engine-2.0.0/adapters/base.py +34 -0
  5. webpilot_engine-2.0.0/adapters/browser_adapter.py +300 -0
  6. webpilot_engine-2.0.0/adapters/dom_scripts.py +518 -0
  7. webpilot_engine-2.0.0/adapters/envelope_builder.py +108 -0
  8. webpilot_engine-2.0.0/adapters/live_session_manager.py +326 -0
  9. webpilot_engine-2.0.0/adapters/upload_adapter.py +77 -0
  10. webpilot_engine-2.0.0/builder.py +83 -0
  11. webpilot_engine-2.0.0/cli.py +341 -0
  12. webpilot_engine-2.0.0/config/__init__.py +23 -0
  13. webpilot_engine-2.0.0/config/settings.py +339 -0
  14. webpilot_engine-2.0.0/constants/__init__.py +165 -0
  15. webpilot_engine-2.0.0/constants/contracts.py +95 -0
  16. webpilot_engine-2.0.0/constants/selectors.py +27 -0
  17. webpilot_engine-2.0.0/constants/timeouts.py +25 -0
  18. webpilot_engine-2.0.0/core/__init__.py +45 -0
  19. webpilot_engine-2.0.0/core/exceptions.py +33 -0
  20. webpilot_engine-2.0.0/core/models.py +273 -0
  21. webpilot_engine-2.0.0/engine.py +199 -0
  22. webpilot_engine-2.0.0/exceptions.py +23 -0
  23. webpilot_engine-2.0.0/mcp_server.py +347 -0
  24. webpilot_engine-2.0.0/models.py +29 -0
  25. webpilot_engine-2.0.0/orchestration/__init__.py +19 -0
  26. webpilot_engine-2.0.0/orchestration/context.py +71 -0
  27. webpilot_engine-2.0.0/orchestration/flow_orchestrator.py +358 -0
  28. webpilot_engine-2.0.0/orchestration/session_coordinator.py +88 -0
  29. webpilot_engine-2.0.0/pyproject.toml +77 -0
  30. webpilot_engine-2.0.0/services/__init__.py +17 -0
  31. webpilot_engine-2.0.0/services/auth_navigation_service.py +129 -0
  32. webpilot_engine-2.0.0/services/field_interaction_service.py +174 -0
  33. webpilot_engine-2.0.0/services/form_filler_service.py +106 -0
  34. webpilot_engine-2.0.0/services/inspection_formatter_service.py +68 -0
  35. webpilot_engine-2.0.0/services/inspection_service.py +40 -0
  36. webpilot_engine-2.0.0/services/reactive_interaction_service.py +174 -0
  37. webpilot_engine-2.0.0/setup.cfg +4 -0
  38. webpilot_engine-2.0.0/supervisor/__init__.py +13 -0
  39. webpilot_engine-2.0.0/supervisor/client.py +171 -0
  40. webpilot_engine-2.0.0/supervisor/contracts.py +62 -0
  41. webpilot_engine-2.0.0/supervisor/master_daemon.py +303 -0
  42. webpilot_engine-2.0.0/supervisor/shell.py +194 -0
  43. webpilot_engine-2.0.0/supervisor/worker_process.py +400 -0
  44. webpilot_engine-2.0.0/tests/test_config_and_builder.py +187 -0
  45. webpilot_engine-2.0.0/tests/test_contracts.py +127 -0
  46. webpilot_engine-2.0.0/tests/test_engine_facade.py +55 -0
  47. webpilot_engine-2.0.0/tests/test_live_session.py +77 -0
  48. webpilot_engine-2.0.0/tests/test_mcp_server.py +79 -0
  49. webpilot_engine-2.0.0/tests/test_orchestration.py +153 -0
  50. webpilot_engine-2.0.0/tests/test_redaction.py +76 -0
  51. webpilot_engine-2.0.0/tests/test_services.py +108 -0
  52. webpilot_engine-2.0.0/tests/test_supervisor.py +83 -0
  53. webpilot_engine-2.0.0/validators/__init__.py +9 -0
  54. webpilot_engine-2.0.0/validators/form_validator.py +28 -0
  55. webpilot_engine-2.0.0/validators/payload_validator.py +25 -0
  56. webpilot_engine-2.0.0/webpilot_engine.egg-info/PKG-INFO +299 -0
  57. webpilot_engine-2.0.0/webpilot_engine.egg-info/SOURCES.txt +59 -0
  58. webpilot_engine-2.0.0/webpilot_engine.egg-info/dependency_links.txt +1 -0
  59. webpilot_engine-2.0.0/webpilot_engine.egg-info/entry_points.txt +6 -0
  60. webpilot_engine-2.0.0/webpilot_engine.egg-info/requires.txt +12 -0
  61. webpilot_engine-2.0.0/webpilot_engine.egg-info/top_level.txt +14 -0
@@ -0,0 +1,299 @@
1
+ Metadata-Version: 2.4
2
+ Name: webpilot-engine
3
+ Version: 2.0.0
4
+ Summary: WebPilot: Enterprise Autonomous Browser Engine, Universal Form Inspector & AI Agent Web Runtime
5
+ Author: Antigravity Engineering
6
+ License: MIT
7
+ Keywords: webpilot,browser-runtime,ai-agent,web-automation,playwright,form-filler,ats-automation,sap-successfactors,workday,browser-supervisor,process-isolation
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Testing
11
+ Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Operating System :: MacOS
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ Requires-Dist: playwright>=1.40.0
23
+ Requires-Dist: python-dotenv>=1.0.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
26
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
27
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
28
+ Requires-Dist: pytest-mock>=3.12.0; extra == "dev"
29
+ Requires-Dist: Faker>=24.0.0; extra == "dev"
30
+ Provides-Extra: mcp
31
+ Requires-Dist: mcp>=1.0.0; extra == "mcp"
32
+
33
+ # WebPilot: Autonomous Multi-Tier Browser Automation Engine & AI Agent Web Runtime
34
+
35
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
36
+ [![Playwright](https://img.shields.io/badge/playwright-v1.40%2B-green.svg)](https://playwright.dev/)
37
+ [![Architecture](https://img.shields.io/badge/architecture-3--Tier%20Multi--Process-orange.svg)](#-3-tier-multi-process-architecture)
38
+ [![Standard User](https://img.shields.io/badge/security-Zero%20Elevation%20(No%20Admin)-success.svg)](#-zero-elevation-standard-user-security)
39
+ [![Tests Passing](https://img.shields.io/badge/tests-27%2F27%20passing-brightgreen.svg)](#-testing--verification)
40
+ [![CLI](https://img.shields.io/badge/cli-webpilot%20%7C%20wp-6f42c1.svg)](#-quick-start-guide)
41
+
42
+ An enterprise-grade, general-purpose autonomous browser engine and AI agent web runtime designed to inspect, interact with, fill, and operate any website, complex Single-Page Application (SPA), or enterprise portal (such as **SAP SuccessFactors**, **Workday**, **Greenhouse**, **Oracle Taleo**, and modern web apps) with zero site-specific selectors or hardcoding.
43
+
44
+ ---
45
+
46
+ ## ๐Ÿ—๏ธ 3-Tier Multi-Process Architecture
47
+
48
+ To solve the fundamental Windows OS limitation where terminal and subshell runners terminate background child processes upon exit (Windows Job Object `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE`), WebPilot implements an elevated-resilient **Zero-Elevation Three-Tier Process Architecture**:
49
+
50
+ ```
51
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
52
+ โ”‚ WebPilot CLI & REPL Shell (webpilot / wp) โ”‚
53
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
54
+ โ”‚ HTTP REST (127.0.0.1:9333)
55
+ โ–ผ
56
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
57
+ โ”‚ Layer 1: Master Supervisor Host (Daemon) โ”‚
58
+ โ”‚ โ€ข Zero Playwright Imports (~15 MB RAM) โ”‚
59
+ โ”‚ โ€ข 30-Minute Inactivity Watchdog (Automatic RAM release) โ”‚
60
+ โ”‚ โ€ข Windows WMI Zero-Touch Auto-Spawn (Session 0 Breakout) โ”‚
61
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
62
+ โ”‚ stdin / stdout (Isolated JSON-RPC)
63
+ โ–ผ
64
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
65
+ โ”‚ Layer 2: Operational Worker Process โ”‚
66
+ โ”‚ โ€ข Playwright Runtime + SessionCoordinator โ”‚
67
+ โ”‚ โ€ข Persistent in-memory browser session across CLI calls โ”‚
68
+ โ”‚ โ€ข DOM Services (Field, Auth, Reactive, Inspection) โ”‚
69
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
70
+ โ”‚ Process Tree Attachment
71
+ โ–ผ
72
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
73
+ โ”‚ Layer 3: Chromium Browser Engine โ”‚
74
+ โ”‚ โ€ข Chromium Main Process + GPU + Renderers โ”‚
75
+ โ”‚ โ€ข Immediate Cascading Kill (taskkill /F /T /PID) โ”‚
76
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
77
+ ```
78
+
79
+ ### โšก Key Architectural Advantages:
80
+ 1. **Persistent Browser Session Across CLI Calls**: Run step-by-step sequential commands (`open` -> `fill username` -> `fill password` -> `press submit`) without restarting the browser or losing active DOM state.
81
+ 2. **Zero-Elevation / Standard User Mode**: Runs 100% as a standard, unprivileged user. **Zero administrative or UAC prompts required** (no `asudo` or Administrator escalation).
82
+ 3. **Cascading Kill & Instant Self-Healing**: Terminating Layer 2 via `taskkill /F /T /PID` instantly eliminates all child Chromium processes with **zero zombie leaks**. Layer 1 survives and automatically respawns a clean Layer 2 in **~300ms**.
83
+ 4. **30-Minute Watchdog Supervisor**: Automatically reclaims 100% of browser memory if the session remains idle for 30 minutes.
84
+
85
+ ---
86
+
87
+ ## ๐ŸŒŸ Core Features
88
+
89
+ - **Universal Inspection (`inspect`)**: Navigates to any URL and outputs a token-optimized, clean schema containing text fields, picklists, radio groups, checkboxes, file uploads, and action buttons.
90
+ - **Dynamic Field Population (`apply`)**: Fills fields dynamically via JSON payloads (`--data`) or inline CLI flags (`--fill`), with automatic type detection (text, combobox, radio, select).
91
+ - **Reactive Interaction Service**:
92
+ - Automatically observes button clicks (`--press`).
93
+ - Detects redirects and route transitions (`[๐Ÿ”€ Redirect]`) and auto-inspects the resulting page.
94
+ - Detects and switches to newly spawned browser tabs/windows (`[๐ŸŒ New Window]`).
95
+ - Detects dynamic DOM expansions and section accordions (`[๐Ÿ“‹ Dynamic Form Expansion]`).
96
+ - **Dynamic Loader Dissolution**:
97
+ - Automatically identifies global blocking overlays (`#loading`, `.sapUiBusy`, `.busyIndicator`, `.modal-backdrop`, `[aria-busy="true"]`) and waits dynamically for their dissolution (`state="hidden"`).
98
+ - Distinguishes between global page-blocking veils and local dropdown loaders.
99
+ - **Modal & Pointer Trap Escape Pipeline**:
100
+ - Resolves modal popups and pointer-locked elements using a 4-stage pipeline: Natural Selection -> Keyboard `Escape` -> Backdrop Click -> DOM Surgical Removal.
101
+ - **Enterprise Picklist Auto-scrolling**:
102
+ - Intelligent scrolling algorithm for virtualized dropdowns (such as SAP picklists with `aria-owns` and scroll containers).
103
+ - **Interactive REPL Shell (`shell`)**:
104
+ - Interactive automation console with real-time feedback, tab switching, and live DOM inspection.
105
+
106
+ ---
107
+
108
+ ## ๐Ÿ“ฆ Installation & Setup
109
+
110
+ ### Option A: Install from PyPI or Editable Mode
111
+ ```bash
112
+ # Editable install into environment
113
+ pip install -e .
114
+
115
+ # Or install dependencies directly
116
+ pip install -r requirements.txt
117
+ playwright install chromium
118
+ ```
119
+
120
+ ### Option B: Standalone Portable Binary (Windows)
121
+ Download `webpilot.exe` from GitHub Releases and run directly without needing a local Python installation.
122
+
123
+ ---
124
+
125
+ ## ๐Ÿš€ Quick Start Guide
126
+
127
+ You can use the full `webpilot` command or the ultra-fast shortcut **`wp`** (or `python cli.py`):
128
+
129
+ ### 1. Check & Start Background Supervisor Service
130
+ ```powershell
131
+ # Check multi-tier service status
132
+ wp service status
133
+
134
+ # Start service (automatically auto-spawns detached host via WMI)
135
+ wp service start
136
+ ```
137
+
138
+ ### 2. Inspect Any Web Page
139
+ ```powershell
140
+ wp inspect --url "https://example.com/portal" --output "schema.json" --screenshot "page.png"
141
+ ```
142
+
143
+ ### 3. Step-by-Step Multi-Turn Web Automation
144
+ Execute sequential commands on the **same live persistent browser session**:
145
+
146
+ ```powershell
147
+ # Step 1: Open target portal and inspect initial schema
148
+ wp apply --url "https://example.com/login" --screenshot "step1.png"
149
+
150
+ # Step 2: Fill email only on the active persistent page
151
+ wp apply --fill "username=john.doe@example.com" --screenshot "step2.png"
152
+
153
+ # Step 3: Fill password only on the active persistent page
154
+ wp apply --fill "password=MySecurePassword123!" --screenshot "step3.png"
155
+
156
+ # Step 4: Click Sign In, detect redirect, auto-inspect profile, and save cookies
157
+ wp apply --press "Sign In" --cookies "session_cookies.json" --screenshot "step4.png"
158
+ ```
159
+
160
+ ### 4. Interactive REPL Shell Mode
161
+ Launch the sub-second interactive REPL shell:
162
+ ```powershell
163
+ wp shell
164
+ ```
165
+
166
+ Inside the shell, enter commands sequentially:
167
+ ```text
168
+ webpilot> open https://example.com/login
169
+ webpilot> fill username=john.doe@example.com
170
+ webpilot> fill password=MySecurePassword123!
171
+ webpilot> press Sign In
172
+ webpilot> tabs
173
+ webpilot> screenshot dashboard.png
174
+ webpilot> exit
175
+ ```
176
+
177
+ ---
178
+
179
+ ## ๐Ÿ› ๏ธ CLI Reference
180
+
181
+ ### Common Global Flags
182
+ - `--host`: Supervisor host address (default: `127.0.0.1`).
183
+ - `--port`: Supervisor port (default: `9333`).
184
+ - `--standalone`: Bypasses Master Supervisor to run in-process via `FlowOrchestrator`.
185
+
186
+ ### `python cli.py inspect`
187
+ Inspects a URL or active session and outputs a clean form schema:
188
+ - `--url <URL>`: Target URL (optional if connecting to existing live session).
189
+ - `--output <path>`: Save full JSON schema to disk.
190
+ - `--screenshot <path>`: Capture page screenshot.
191
+ - `--cookies <path>`: Load session cookies.
192
+ - `--unpack-options`: Probe dropdowns to sample options.
193
+ - `--tab <index>`: Inspect specific tab by index.
194
+ - `--list-tabs`: List all open tabs in active session.
195
+
196
+ ### `python cli.py apply`
197
+ Fills fields, uploads files, presses buttons, and validates state:
198
+ - `--url <URL>`: Target URL (optional if operating on existing page).
199
+ - `--data <path>`: Load key-value mappings from JSON file.
200
+ - `--fill <key=val>`: Set field value (can be repeated).
201
+ - `--press <btn>`: Click button with reactive observation (can be repeated).
202
+ - `--upload <kw=file>`: Upload document to upload area (can be repeated).
203
+ - `--cookies <path>`: Save or load session cookies.
204
+ - `--submit`: Submit form after filling.
205
+ - `--screenshot <path>`: Capture post-interaction screenshot.
206
+ - `--no-auto-inspect`: Disable automatic post-interaction schema inspection.
207
+
208
+ ### `python cli.py service`
209
+ Manages the Master Supervisor daemon:
210
+ - `python cli.py service status`: Query real-time PID telemetry for Layer 1, Layer 2, and Layer 3.
211
+ - `python cli.py service restart`: Trigger cascading kill of Layer 2 & Layer 3, and respawn fresh worker (~300ms).
212
+ - `python cli.py service stop`: Cleanly terminate all tiers and release all memory.
213
+ - `python cli.py service start`: Ensure Layer 1 daemon is running.
214
+
215
+ ---
216
+
217
+ ## ๐Ÿ“ Project Directory Layout
218
+
219
+ ```
220
+ universal_web_applier/
221
+ โ”œโ”€โ”€ adapters/
222
+ โ”‚ โ”œโ”€โ”€ browser_adapter.py # Playwright & Chromium connection adapter
223
+ โ”‚ โ”œโ”€โ”€ dom_scripts.py # Pure JavaScript DOM manipulation scripts
224
+ โ”‚ โ”œโ”€โ”€ live_session_manager.py # Legacy CDP live session fallback
225
+ โ”‚ โ””โ”€โ”€ upload_adapter.py # Intelligent file upload handler
226
+ โ”œโ”€โ”€ config/
227
+ โ”‚ โ”œโ”€โ”€ builder.py # Payload & Envelope builders
228
+ โ”‚ โ”œโ”€โ”€ settings.py # 3-tier settings resolver (env -> .env -> json)
229
+ โ”‚ โ”œโ”€โ”€ settings.json # Active settings
230
+ โ”‚ โ””โ”€โ”€ device_profile.json # Browser fingerprint & viewport settings
231
+ โ”œโ”€โ”€ constants/
232
+ โ”‚ โ”œโ”€โ”€ contracts.py # Single Source of Truth for JSON contracts
233
+ โ”‚ โ””โ”€โ”€ timeouts.py # Centralized timeouts and pauses
234
+ โ”œโ”€โ”€ core/
235
+ โ”‚ โ””โ”€โ”€ models.py # Dataclasses & schema models
236
+ โ”œโ”€โ”€ orchestration/
237
+ โ”‚ โ”œโ”€โ”€ context.py # Request & session contexts
238
+ โ”‚ โ”œโ”€โ”€ flow_orchestrator.py # In-process standalone workflow pipeline
239
+ โ”‚ โ””โ”€โ”€ session_coordinator.py # Session lifecycle coordinator
240
+ โ”œโ”€โ”€ services/
241
+ โ”‚ โ”œโ”€โ”€ auth_navigation_service.py # Login detection & portal transitions
242
+ โ”‚ โ”œโ”€โ”€ field_interaction_service.py# Field value injection & verification
243
+ โ”‚ โ”œโ”€โ”€ inspection_service.py # DOM inspection & schema extraction
244
+ โ”‚ โ”œโ”€โ”€ inspection_formatter_service.py # Lean human-readable summary formatter
245
+ โ”‚ โ””โ”€โ”€ reactive_interaction_service.py # Post-click reactive changes observer
246
+ โ”œโ”€โ”€ supervisor/
247
+ โ”‚ โ”œโ”€โ”€ contracts.py # Supervisor request/response contracts
248
+ โ”‚ โ”œโ”€โ”€ master_daemon.py # Layer 1: Lightweight HTTP Daemon
249
+ โ”‚ โ”œโ”€โ”€ worker_process.py # Layer 2: Supervised JSON-RPC Worker
250
+ โ”‚ โ”œโ”€โ”€ client.py # Zero-Touch WMI client & HTTP proxy
251
+ โ”‚ โ””โ”€โ”€ shell.py # Interactive REPL automation shell
252
+ โ”œโ”€โ”€ tests/
253
+ โ”‚ โ”œโ”€โ”€ test_contracts.py # Wire contract unit tests
254
+ โ”‚ โ”œโ”€โ”€ test_engine_facade.py # Engine facade tests
255
+ โ”‚ โ”œโ”€โ”€ test_live_session.py # Live session tests
256
+ โ”‚ โ”œโ”€โ”€ test_orchestration.py # Pipeline orchestration tests
257
+ โ”‚ โ”œโ”€โ”€ test_redaction.py # Security & credential redaction tests
258
+ โ”‚ โ”œโ”€โ”€ test_services.py # DOM interaction services tests
259
+ โ”‚ โ””โ”€โ”€ test_supervisor.py # Master supervisor & client unit tests
260
+ โ”œโ”€โ”€ cli.py # Unified CLI entrypoint
261
+ โ”œโ”€โ”€ requirements.txt # Python dependencies
262
+ โ”œโ”€โ”€ pyproject.toml # Modern package specifications
263
+ โ””โ”€โ”€ README.md # Master documentation
264
+ ```
265
+
266
+ ---
267
+
268
+ ## ๐Ÿงช Testing & Verification
269
+
270
+ Run the comprehensive unit test suite:
271
+ ```powershell
272
+ python -m pytest tests/
273
+ ```
274
+
275
+ All 27 contract and service tests execute in < 25s:
276
+ ```text
277
+ tests\test_contracts.py .... [ 14%]
278
+ tests\test_engine_facade.py ... [ 25%]
279
+ tests\test_live_session.py .. [ 33%]
280
+ tests\test_orchestration.py ... [ 44%]
281
+ tests\test_redaction.py .... [ 59%]
282
+ tests\test_services.py ....... [ 85%]
283
+ tests\test_supervisor.py .... [100%]
284
+
285
+ ============================= 27 passed in 22.58s =============================
286
+ ```
287
+
288
+ ---
289
+
290
+ ## ๐Ÿ”’ Security & Privacy
291
+
292
+ - **Credential Redaction**: Passwords, auth tokens, and sensitive inputs are automatically redacted in CLI outputs, telemetry cards, and logs.
293
+ - **Zero Administrative Elevation**: Does not require Administrator rights or elevated Windows tokens.
294
+ - **Local Isolation**: Master Supervisor listens exclusively on loopback `127.0.0.1:9333`.
295
+
296
+ ---
297
+
298
+ ## ๐Ÿ“„ License
299
+ MIT License. Free for commercial and personal use.
@@ -0,0 +1,267 @@
1
+ # WebPilot: Autonomous Multi-Tier Browser Automation Engine & AI Agent Web Runtime
2
+
3
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
4
+ [![Playwright](https://img.shields.io/badge/playwright-v1.40%2B-green.svg)](https://playwright.dev/)
5
+ [![Architecture](https://img.shields.io/badge/architecture-3--Tier%20Multi--Process-orange.svg)](#-3-tier-multi-process-architecture)
6
+ [![Standard User](https://img.shields.io/badge/security-Zero%20Elevation%20(No%20Admin)-success.svg)](#-zero-elevation-standard-user-security)
7
+ [![Tests Passing](https://img.shields.io/badge/tests-27%2F27%20passing-brightgreen.svg)](#-testing--verification)
8
+ [![CLI](https://img.shields.io/badge/cli-webpilot%20%7C%20wp-6f42c1.svg)](#-quick-start-guide)
9
+
10
+ An enterprise-grade, general-purpose autonomous browser engine and AI agent web runtime designed to inspect, interact with, fill, and operate any website, complex Single-Page Application (SPA), or enterprise portal (such as **SAP SuccessFactors**, **Workday**, **Greenhouse**, **Oracle Taleo**, and modern web apps) with zero site-specific selectors or hardcoding.
11
+
12
+ ---
13
+
14
+ ## ๐Ÿ—๏ธ 3-Tier Multi-Process Architecture
15
+
16
+ To solve the fundamental Windows OS limitation where terminal and subshell runners terminate background child processes upon exit (Windows Job Object `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE`), WebPilot implements an elevated-resilient **Zero-Elevation Three-Tier Process Architecture**:
17
+
18
+ ```
19
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
20
+ โ”‚ WebPilot CLI & REPL Shell (webpilot / wp) โ”‚
21
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
22
+ โ”‚ HTTP REST (127.0.0.1:9333)
23
+ โ–ผ
24
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
25
+ โ”‚ Layer 1: Master Supervisor Host (Daemon) โ”‚
26
+ โ”‚ โ€ข Zero Playwright Imports (~15 MB RAM) โ”‚
27
+ โ”‚ โ€ข 30-Minute Inactivity Watchdog (Automatic RAM release) โ”‚
28
+ โ”‚ โ€ข Windows WMI Zero-Touch Auto-Spawn (Session 0 Breakout) โ”‚
29
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
30
+ โ”‚ stdin / stdout (Isolated JSON-RPC)
31
+ โ–ผ
32
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
33
+ โ”‚ Layer 2: Operational Worker Process โ”‚
34
+ โ”‚ โ€ข Playwright Runtime + SessionCoordinator โ”‚
35
+ โ”‚ โ€ข Persistent in-memory browser session across CLI calls โ”‚
36
+ โ”‚ โ€ข DOM Services (Field, Auth, Reactive, Inspection) โ”‚
37
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
38
+ โ”‚ Process Tree Attachment
39
+ โ–ผ
40
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
41
+ โ”‚ Layer 3: Chromium Browser Engine โ”‚
42
+ โ”‚ โ€ข Chromium Main Process + GPU + Renderers โ”‚
43
+ โ”‚ โ€ข Immediate Cascading Kill (taskkill /F /T /PID) โ”‚
44
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
45
+ ```
46
+
47
+ ### โšก Key Architectural Advantages:
48
+ 1. **Persistent Browser Session Across CLI Calls**: Run step-by-step sequential commands (`open` -> `fill username` -> `fill password` -> `press submit`) without restarting the browser or losing active DOM state.
49
+ 2. **Zero-Elevation / Standard User Mode**: Runs 100% as a standard, unprivileged user. **Zero administrative or UAC prompts required** (no `asudo` or Administrator escalation).
50
+ 3. **Cascading Kill & Instant Self-Healing**: Terminating Layer 2 via `taskkill /F /T /PID` instantly eliminates all child Chromium processes with **zero zombie leaks**. Layer 1 survives and automatically respawns a clean Layer 2 in **~300ms**.
51
+ 4. **30-Minute Watchdog Supervisor**: Automatically reclaims 100% of browser memory if the session remains idle for 30 minutes.
52
+
53
+ ---
54
+
55
+ ## ๐ŸŒŸ Core Features
56
+
57
+ - **Universal Inspection (`inspect`)**: Navigates to any URL and outputs a token-optimized, clean schema containing text fields, picklists, radio groups, checkboxes, file uploads, and action buttons.
58
+ - **Dynamic Field Population (`apply`)**: Fills fields dynamically via JSON payloads (`--data`) or inline CLI flags (`--fill`), with automatic type detection (text, combobox, radio, select).
59
+ - **Reactive Interaction Service**:
60
+ - Automatically observes button clicks (`--press`).
61
+ - Detects redirects and route transitions (`[๐Ÿ”€ Redirect]`) and auto-inspects the resulting page.
62
+ - Detects and switches to newly spawned browser tabs/windows (`[๐ŸŒ New Window]`).
63
+ - Detects dynamic DOM expansions and section accordions (`[๐Ÿ“‹ Dynamic Form Expansion]`).
64
+ - **Dynamic Loader Dissolution**:
65
+ - Automatically identifies global blocking overlays (`#loading`, `.sapUiBusy`, `.busyIndicator`, `.modal-backdrop`, `[aria-busy="true"]`) and waits dynamically for their dissolution (`state="hidden"`).
66
+ - Distinguishes between global page-blocking veils and local dropdown loaders.
67
+ - **Modal & Pointer Trap Escape Pipeline**:
68
+ - Resolves modal popups and pointer-locked elements using a 4-stage pipeline: Natural Selection -> Keyboard `Escape` -> Backdrop Click -> DOM Surgical Removal.
69
+ - **Enterprise Picklist Auto-scrolling**:
70
+ - Intelligent scrolling algorithm for virtualized dropdowns (such as SAP picklists with `aria-owns` and scroll containers).
71
+ - **Interactive REPL Shell (`shell`)**:
72
+ - Interactive automation console with real-time feedback, tab switching, and live DOM inspection.
73
+
74
+ ---
75
+
76
+ ## ๐Ÿ“ฆ Installation & Setup
77
+
78
+ ### Option A: Install from PyPI or Editable Mode
79
+ ```bash
80
+ # Editable install into environment
81
+ pip install -e .
82
+
83
+ # Or install dependencies directly
84
+ pip install -r requirements.txt
85
+ playwright install chromium
86
+ ```
87
+
88
+ ### Option B: Standalone Portable Binary (Windows)
89
+ Download `webpilot.exe` from GitHub Releases and run directly without needing a local Python installation.
90
+
91
+ ---
92
+
93
+ ## ๐Ÿš€ Quick Start Guide
94
+
95
+ You can use the full `webpilot` command or the ultra-fast shortcut **`wp`** (or `python cli.py`):
96
+
97
+ ### 1. Check & Start Background Supervisor Service
98
+ ```powershell
99
+ # Check multi-tier service status
100
+ wp service status
101
+
102
+ # Start service (automatically auto-spawns detached host via WMI)
103
+ wp service start
104
+ ```
105
+
106
+ ### 2. Inspect Any Web Page
107
+ ```powershell
108
+ wp inspect --url "https://example.com/portal" --output "schema.json" --screenshot "page.png"
109
+ ```
110
+
111
+ ### 3. Step-by-Step Multi-Turn Web Automation
112
+ Execute sequential commands on the **same live persistent browser session**:
113
+
114
+ ```powershell
115
+ # Step 1: Open target portal and inspect initial schema
116
+ wp apply --url "https://example.com/login" --screenshot "step1.png"
117
+
118
+ # Step 2: Fill email only on the active persistent page
119
+ wp apply --fill "username=john.doe@example.com" --screenshot "step2.png"
120
+
121
+ # Step 3: Fill password only on the active persistent page
122
+ wp apply --fill "password=MySecurePassword123!" --screenshot "step3.png"
123
+
124
+ # Step 4: Click Sign In, detect redirect, auto-inspect profile, and save cookies
125
+ wp apply --press "Sign In" --cookies "session_cookies.json" --screenshot "step4.png"
126
+ ```
127
+
128
+ ### 4. Interactive REPL Shell Mode
129
+ Launch the sub-second interactive REPL shell:
130
+ ```powershell
131
+ wp shell
132
+ ```
133
+
134
+ Inside the shell, enter commands sequentially:
135
+ ```text
136
+ webpilot> open https://example.com/login
137
+ webpilot> fill username=john.doe@example.com
138
+ webpilot> fill password=MySecurePassword123!
139
+ webpilot> press Sign In
140
+ webpilot> tabs
141
+ webpilot> screenshot dashboard.png
142
+ webpilot> exit
143
+ ```
144
+
145
+ ---
146
+
147
+ ## ๐Ÿ› ๏ธ CLI Reference
148
+
149
+ ### Common Global Flags
150
+ - `--host`: Supervisor host address (default: `127.0.0.1`).
151
+ - `--port`: Supervisor port (default: `9333`).
152
+ - `--standalone`: Bypasses Master Supervisor to run in-process via `FlowOrchestrator`.
153
+
154
+ ### `python cli.py inspect`
155
+ Inspects a URL or active session and outputs a clean form schema:
156
+ - `--url <URL>`: Target URL (optional if connecting to existing live session).
157
+ - `--output <path>`: Save full JSON schema to disk.
158
+ - `--screenshot <path>`: Capture page screenshot.
159
+ - `--cookies <path>`: Load session cookies.
160
+ - `--unpack-options`: Probe dropdowns to sample options.
161
+ - `--tab <index>`: Inspect specific tab by index.
162
+ - `--list-tabs`: List all open tabs in active session.
163
+
164
+ ### `python cli.py apply`
165
+ Fills fields, uploads files, presses buttons, and validates state:
166
+ - `--url <URL>`: Target URL (optional if operating on existing page).
167
+ - `--data <path>`: Load key-value mappings from JSON file.
168
+ - `--fill <key=val>`: Set field value (can be repeated).
169
+ - `--press <btn>`: Click button with reactive observation (can be repeated).
170
+ - `--upload <kw=file>`: Upload document to upload area (can be repeated).
171
+ - `--cookies <path>`: Save or load session cookies.
172
+ - `--submit`: Submit form after filling.
173
+ - `--screenshot <path>`: Capture post-interaction screenshot.
174
+ - `--no-auto-inspect`: Disable automatic post-interaction schema inspection.
175
+
176
+ ### `python cli.py service`
177
+ Manages the Master Supervisor daemon:
178
+ - `python cli.py service status`: Query real-time PID telemetry for Layer 1, Layer 2, and Layer 3.
179
+ - `python cli.py service restart`: Trigger cascading kill of Layer 2 & Layer 3, and respawn fresh worker (~300ms).
180
+ - `python cli.py service stop`: Cleanly terminate all tiers and release all memory.
181
+ - `python cli.py service start`: Ensure Layer 1 daemon is running.
182
+
183
+ ---
184
+
185
+ ## ๐Ÿ“ Project Directory Layout
186
+
187
+ ```
188
+ universal_web_applier/
189
+ โ”œโ”€โ”€ adapters/
190
+ โ”‚ โ”œโ”€โ”€ browser_adapter.py # Playwright & Chromium connection adapter
191
+ โ”‚ โ”œโ”€โ”€ dom_scripts.py # Pure JavaScript DOM manipulation scripts
192
+ โ”‚ โ”œโ”€โ”€ live_session_manager.py # Legacy CDP live session fallback
193
+ โ”‚ โ””โ”€โ”€ upload_adapter.py # Intelligent file upload handler
194
+ โ”œโ”€โ”€ config/
195
+ โ”‚ โ”œโ”€โ”€ builder.py # Payload & Envelope builders
196
+ โ”‚ โ”œโ”€โ”€ settings.py # 3-tier settings resolver (env -> .env -> json)
197
+ โ”‚ โ”œโ”€โ”€ settings.json # Active settings
198
+ โ”‚ โ””โ”€โ”€ device_profile.json # Browser fingerprint & viewport settings
199
+ โ”œโ”€โ”€ constants/
200
+ โ”‚ โ”œโ”€โ”€ contracts.py # Single Source of Truth for JSON contracts
201
+ โ”‚ โ””โ”€โ”€ timeouts.py # Centralized timeouts and pauses
202
+ โ”œโ”€โ”€ core/
203
+ โ”‚ โ””โ”€โ”€ models.py # Dataclasses & schema models
204
+ โ”œโ”€โ”€ orchestration/
205
+ โ”‚ โ”œโ”€โ”€ context.py # Request & session contexts
206
+ โ”‚ โ”œโ”€โ”€ flow_orchestrator.py # In-process standalone workflow pipeline
207
+ โ”‚ โ””โ”€โ”€ session_coordinator.py # Session lifecycle coordinator
208
+ โ”œโ”€โ”€ services/
209
+ โ”‚ โ”œโ”€โ”€ auth_navigation_service.py # Login detection & portal transitions
210
+ โ”‚ โ”œโ”€โ”€ field_interaction_service.py# Field value injection & verification
211
+ โ”‚ โ”œโ”€โ”€ inspection_service.py # DOM inspection & schema extraction
212
+ โ”‚ โ”œโ”€โ”€ inspection_formatter_service.py # Lean human-readable summary formatter
213
+ โ”‚ โ””โ”€โ”€ reactive_interaction_service.py # Post-click reactive changes observer
214
+ โ”œโ”€โ”€ supervisor/
215
+ โ”‚ โ”œโ”€โ”€ contracts.py # Supervisor request/response contracts
216
+ โ”‚ โ”œโ”€โ”€ master_daemon.py # Layer 1: Lightweight HTTP Daemon
217
+ โ”‚ โ”œโ”€โ”€ worker_process.py # Layer 2: Supervised JSON-RPC Worker
218
+ โ”‚ โ”œโ”€โ”€ client.py # Zero-Touch WMI client & HTTP proxy
219
+ โ”‚ โ””โ”€โ”€ shell.py # Interactive REPL automation shell
220
+ โ”œโ”€โ”€ tests/
221
+ โ”‚ โ”œโ”€โ”€ test_contracts.py # Wire contract unit tests
222
+ โ”‚ โ”œโ”€โ”€ test_engine_facade.py # Engine facade tests
223
+ โ”‚ โ”œโ”€โ”€ test_live_session.py # Live session tests
224
+ โ”‚ โ”œโ”€โ”€ test_orchestration.py # Pipeline orchestration tests
225
+ โ”‚ โ”œโ”€โ”€ test_redaction.py # Security & credential redaction tests
226
+ โ”‚ โ”œโ”€โ”€ test_services.py # DOM interaction services tests
227
+ โ”‚ โ””โ”€โ”€ test_supervisor.py # Master supervisor & client unit tests
228
+ โ”œโ”€โ”€ cli.py # Unified CLI entrypoint
229
+ โ”œโ”€โ”€ requirements.txt # Python dependencies
230
+ โ”œโ”€โ”€ pyproject.toml # Modern package specifications
231
+ โ””โ”€โ”€ README.md # Master documentation
232
+ ```
233
+
234
+ ---
235
+
236
+ ## ๐Ÿงช Testing & Verification
237
+
238
+ Run the comprehensive unit test suite:
239
+ ```powershell
240
+ python -m pytest tests/
241
+ ```
242
+
243
+ All 27 contract and service tests execute in < 25s:
244
+ ```text
245
+ tests\test_contracts.py .... [ 14%]
246
+ tests\test_engine_facade.py ... [ 25%]
247
+ tests\test_live_session.py .. [ 33%]
248
+ tests\test_orchestration.py ... [ 44%]
249
+ tests\test_redaction.py .... [ 59%]
250
+ tests\test_services.py ....... [ 85%]
251
+ tests\test_supervisor.py .... [100%]
252
+
253
+ ============================= 27 passed in 22.58s =============================
254
+ ```
255
+
256
+ ---
257
+
258
+ ## ๐Ÿ”’ Security & Privacy
259
+
260
+ - **Credential Redaction**: Passwords, auth tokens, and sensitive inputs are automatically redacted in CLI outputs, telemetry cards, and logs.
261
+ - **Zero Administrative Elevation**: Does not require Administrator rights or elevated Windows tokens.
262
+ - **Local Isolation**: Master Supervisor listens exclusively on loopback `127.0.0.1:9333`.
263
+
264
+ ---
265
+
266
+ ## ๐Ÿ“„ License
267
+ MIT License. Free for commercial and personal use.
@@ -0,0 +1,14 @@
1
+ """Adapters package for universal web applier."""
2
+
3
+ from adapters.base import BrowserAdapterProtocol, UploadAdapterProtocol
4
+ from adapters.browser_adapter import BrowserAdapter
5
+ from adapters.upload_adapter import UploadAdapter
6
+ import adapters.dom_scripts as dom_scripts
7
+
8
+ __all__ = [
9
+ "BrowserAdapterProtocol",
10
+ "UploadAdapterProtocol",
11
+ "BrowserAdapter",
12
+ "UploadAdapter",
13
+ "dom_scripts",
14
+ ]
@@ -0,0 +1,34 @@
1
+ """Adapter protocols and shared interface contracts."""
2
+
3
+ from typing import Any, Dict, List, Optional, Protocol
4
+ from playwright.sync_api import BrowserContext, Page
5
+
6
+ class BrowserAdapterProtocol(Protocol):
7
+ """Protocol for browser runtime management."""
8
+
9
+ @property
10
+ def page(self) -> Optional[Page]:
11
+ ...
12
+
13
+ @property
14
+ def context(self) -> Optional[BrowserContext]:
15
+ ...
16
+
17
+ def start(self, cookies_path: Optional[str] = None) -> None:
18
+ ...
19
+
20
+ def stop(self) -> None:
21
+ ...
22
+
23
+ def navigate(self, url: str, wait_timeout: Optional[int] = None) -> None:
24
+ ...
25
+
26
+ def capture_screenshot(self, output_path: str, full_page: bool = False) -> None:
27
+ ...
28
+
29
+
30
+ class UploadAdapterProtocol(Protocol):
31
+ """Protocol for document attachment operations."""
32
+
33
+ def upload_document(self, file_path: str, document_type_keyword: str = "") -> bool:
34
+ ...