zerodom 0.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.
- zerodom-0.0.1/.gitignore +13 -0
- zerodom-0.0.1/LICENSE +95 -0
- zerodom-0.0.1/PKG-INFO +168 -0
- zerodom-0.0.1/README.md +520 -0
- zerodom-0.0.1/README.pypi.md +144 -0
- zerodom-0.0.1/SECURITY.md +90 -0
- zerodom-0.0.1/benchmarks/benchmark_tokens.py +66 -0
- zerodom-0.0.1/benchmarks/benchmark_vs_a11y.py +80 -0
- zerodom-0.0.1/pyproject.toml +52 -0
- zerodom-0.0.1/tests/test_cli.py +71 -0
- zerodom-0.0.1/tests/test_mcp.py +207 -0
- zerodom-0.0.1/tests/test_parser.py +465 -0
- zerodom-0.0.1/tests/test_playwright.py +259 -0
- zerodom-0.0.1/uv.lock +1647 -0
- zerodom-0.0.1/zerodom/__init__.py +8 -0
- zerodom-0.0.1/zerodom/cli.py +163 -0
- zerodom-0.0.1/zerodom/label_linker.py +119 -0
- zerodom-0.0.1/zerodom/mcp_server.py +180 -0
- zerodom-0.0.1/zerodom/parser.py +440 -0
- zerodom-0.0.1/zerodom/playwright_wrapper.py +72 -0
- zerodom-0.0.1/zerodom/report.py +375 -0
zerodom-0.0.1/.gitignore
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
.venv/
|
|
4
|
+
.pytest_cache/
|
|
5
|
+
dist/
|
|
6
|
+
*.egg-info/
|
|
7
|
+
|
|
8
|
+
# session transcripts and scratch captures — local only
|
|
9
|
+
*-this-session-is-being-continued-from-a-previous-c.txt
|
|
10
|
+
assets/screenshot.png
|
|
11
|
+
# regenerable: `zerodom inspect --render --screenshot ... --html ... demo/demo-page.html`
|
|
12
|
+
demo/report.html
|
|
13
|
+
demo/annotated.png
|
zerodom-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: Syed Husnain Khalid
|
|
6
|
+
|
|
7
|
+
Licensed Work: ZeroDOM
|
|
8
|
+
The Licensed Work is (c) 2026 Syed Husnain Khalid
|
|
9
|
+
|
|
10
|
+
Additional Use Grant: You may make production use of the Licensed Work,
|
|
11
|
+
provided you do not offer the Licensed Work to third
|
|
12
|
+
parties as a hosted, managed, or embedded service where
|
|
13
|
+
the primary value of that service is the functionality
|
|
14
|
+
of the Licensed Work.
|
|
15
|
+
|
|
16
|
+
Change Date: 2030-08-09
|
|
17
|
+
|
|
18
|
+
Change License: Apache License, Version 2.0
|
|
19
|
+
|
|
20
|
+
For information about alternative licensing arrangements for the Licensed Work,
|
|
21
|
+
please contact the Licensor at contact@vexralabs.com.
|
|
22
|
+
|
|
23
|
+
-----------------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
Business Source License 1.1
|
|
26
|
+
|
|
27
|
+
License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
28
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
29
|
+
|
|
30
|
+
Terms
|
|
31
|
+
|
|
32
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
33
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
34
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
35
|
+
production use.
|
|
36
|
+
|
|
37
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
38
|
+
available distribution of a specific version of the Licensed Work under this
|
|
39
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
40
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
41
|
+
above terminate.
|
|
42
|
+
|
|
43
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
44
|
+
currently in effect as described in this License, you must purchase a
|
|
45
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
46
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
47
|
+
|
|
48
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
49
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
50
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
51
|
+
for each version of the Licensed Work released by Licensor.
|
|
52
|
+
|
|
53
|
+
You must conspicuously display this License on each original or modified copy
|
|
54
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
55
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
56
|
+
License apply to your use of that work.
|
|
57
|
+
|
|
58
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
59
|
+
terminate your rights under this License for the current and all other
|
|
60
|
+
versions of the Licensed Work.
|
|
61
|
+
|
|
62
|
+
This License does not grant you any right in any trademark or logo of
|
|
63
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
64
|
+
Licensor as expressly required by this License).
|
|
65
|
+
|
|
66
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
67
|
+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
68
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
69
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
70
|
+
TITLE.
|
|
71
|
+
|
|
72
|
+
MariaDB hereby grants you permission to use this License’s text to license
|
|
73
|
+
your works, and to refer to it using the trademark “Business Source License”,
|
|
74
|
+
as long as you comply with the Covenants of Licensor below.
|
|
75
|
+
|
|
76
|
+
Covenants of Licensor
|
|
77
|
+
|
|
78
|
+
In consideration of the right to use this License’s text and the “Business
|
|
79
|
+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
80
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
81
|
+
|
|
82
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
83
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
84
|
+
where “compatible” means that software provided under the Change License can
|
|
85
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
86
|
+
later version. Licensor may specify additional Change Licenses without
|
|
87
|
+
limitation.
|
|
88
|
+
|
|
89
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
90
|
+
impose any additional restriction on the right granted in this License, as
|
|
91
|
+
the Additional Use Grant; or (b) insert the text “None”.
|
|
92
|
+
|
|
93
|
+
3. To specify a Change Date.
|
|
94
|
+
|
|
95
|
+
4. Not to modify this License in any other way.
|
zerodom-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zerodom
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: DOM-to-Interaction-Graph middleware for AI web agents
|
|
5
|
+
Project-URL: Homepage, https://github.com/DevHusnainAi/zerodom
|
|
6
|
+
Project-URL: Repository, https://github.com/DevHusnainAi/zerodom
|
|
7
|
+
Project-URL: Issues, https://github.com/DevHusnainAi/zerodom/issues
|
|
8
|
+
Author-email: Syed Husnain Khalid <contact@vexralabs.com>
|
|
9
|
+
License-Expression: BUSL-1.1
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agent,browser-automation,dom,llm,mcp,playwright,tokens
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: Other/Proprietary License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
|
|
17
|
+
Classifier: Topic :: Text Processing :: Markup :: HTML
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Requires-Dist: lxml
|
|
20
|
+
Requires-Dist: mcp[cli]
|
|
21
|
+
Requires-Dist: playwright
|
|
22
|
+
Requires-Dist: tiktoken
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# ZeroDOM
|
|
26
|
+
|
|
27
|
+
### Your agent doesn't need the DOM. It needs to know what it can click.
|
|
28
|
+
|
|
29
|
+
ZeroDOM turns a bloated HTML page into a token-optimized **interaction graph** —
|
|
30
|
+
the buttons, inputs and links an agent can actually act on, and nothing else.
|
|
31
|
+
|
|
32
|
+
An agent driving a browser gets one of two action spaces today, and both are bad.
|
|
33
|
+
**Pixels** are slow, expensive, and produce coordinates that go stale the moment
|
|
34
|
+
the page scrolls. **The accessibility tree** is cheaper but enormous, and it has
|
|
35
|
+
no stable handles: 102 of Hacker News' 220 actionable nodes share a
|
|
36
|
+
`(role, name)` pair with another node, so there is no way to say *which* story to
|
|
37
|
+
upvote.
|
|
38
|
+
|
|
39
|
+
ZeroDOM is a third option — a flat list of what the page can do, where every
|
|
40
|
+
entry has a stable id, and the addressing information that makes it clickable
|
|
41
|
+
never enters the context window. About **10 tokens per action, on every page
|
|
42
|
+
tested**.
|
|
43
|
+
|
|
44
|
+
- **No LLM in the loop.** lxml in, graph out, 10–30ms, identical output every run.
|
|
45
|
+
- **Selectors never enter the context window.** The model sees `[03]`; the CSS
|
|
46
|
+
path stays in `selector_map()` on your side.
|
|
47
|
+
- **Nothing leaves your machine.** No telemetry, no API keys, no storage — the
|
|
48
|
+
only network traffic is the page you pointed it at.
|
|
49
|
+
- **The selectors actually resolve.** Verified in a real browser: 231/231 on
|
|
50
|
+
Hacker News, where rows carry no `id` or `class` and numeric ids need escaping.
|
|
51
|
+
|
|
52
|
+
## Install
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install zerodom
|
|
56
|
+
# or: uvx zerodom — the CLI runs straight off PyPI
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
One extra step only if you use the browser-backed features (`from_page`,
|
|
60
|
+
`--render`, `--screenshot`, `--html`):
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
playwright install chromium
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Quickstart
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from zerodom import ZeroDOM
|
|
70
|
+
|
|
71
|
+
graph = ZeroDOM.from_page(page) # any Playwright page, sync or async
|
|
72
|
+
print(graph.to_compact_text()) # what you send the model
|
|
73
|
+
selectors = graph.selector_map() # {"node_01": "#email-input", ...} — stays your side
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Real output:
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
PAGE: Orbit — Fleet Console | file:///…/demo/demo-page.html
|
|
80
|
+
[01] a 'Fleet'
|
|
81
|
+
[05] input 'Search'
|
|
82
|
+
[07] input* 'Assigned driver' ph='Search by name'
|
|
83
|
+
[15] button 'Dispatch'
|
|
84
|
+
[17] button! 'Recall (in transit)'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`*` marks required, `!` marks disabled. The model answers `click 15`. You resolve
|
|
88
|
+
`node_15` against `selector_map()` and click it.
|
|
89
|
+
|
|
90
|
+
## Cost per action
|
|
91
|
+
|
|
92
|
+
The fair comparison isn't raw HTML — nobody sends a model raw HTML. It's
|
|
93
|
+
Playwright's `page.aria_snapshot(mode="ai")`, which is what Playwright MCP puts
|
|
94
|
+
in a model's context.
|
|
95
|
+
|
|
96
|
+
| page | ZeroDOM | ARIA |
|
|
97
|
+
|---|---:|---:|
|
|
98
|
+
| airbnb.com | **9.9** | 23.3 |
|
|
99
|
+
| github.com/…/issues | **12.1** | 70.2 |
|
|
100
|
+
| en.wikipedia.org article | **11.6** | 41.0 |
|
|
101
|
+
| news.ycombinator.com | **10.2** | 47.0 |
|
|
102
|
+
| developer.mozilla.org | **9.9** | 46.8 |
|
|
103
|
+
|
|
104
|
+
*tokens per actionable node — measured 2026-08-03*
|
|
105
|
+
|
|
106
|
+
**~10 tokens per action, flat across every page**, against 23–70 and wildly
|
|
107
|
+
variable. Mean 71.0% fewer tokens than the snapshot a model actually gets, and
|
|
108
|
+
93.1% against raw HTML.
|
|
109
|
+
|
|
110
|
+
## MCP server
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"mcpServers": {
|
|
115
|
+
"zerodom": {
|
|
116
|
+
"command": "uvx",
|
|
117
|
+
"args": ["--from", "zerodom", "zerodom-mcp"]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Goes in `claude_desktop_config.json` for Claude Desktop, or `.cursor/mcp.json`
|
|
124
|
+
for Cursor.
|
|
125
|
+
|
|
126
|
+
| tool | what it does |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `zerodom_parse_url(url, verbose=False)` | navigate, return the compact graph |
|
|
129
|
+
| `zerodom_read_page(verbose=False)` | re-read the live DOM **without navigating** |
|
|
130
|
+
| `zerodom_find(query)` | return only the nodes matching a phrase |
|
|
131
|
+
| `zerodom_click_node(node_id)` | click, then return **what changed** |
|
|
132
|
+
| `zerodom_fill_node(node_id, text)` | type, then return what changed |
|
|
133
|
+
|
|
134
|
+
An agent loop shouldn't re-read the page it already has. `zerodom_find` answers
|
|
135
|
+
"where's the dispatch button?" in one line, and actions return a diff — `+`
|
|
136
|
+
appeared, `-` gone, `~` value changed — instead of re-listing every node.
|
|
137
|
+
|
|
138
|
+
## CLI
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
zerodom https://news.ycombinator.com # compact graph + token savings
|
|
142
|
+
zerodom https://example.com --find checkout # only the nodes that match
|
|
143
|
+
zerodom https://example.com --render # headless Chromium, for JS-heavy pages
|
|
144
|
+
zerodom https://example.com --json # full JSON graph, selectors included
|
|
145
|
+
zerodom https://example.com --html out.html # graph beside an annotated screenshot
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Limitations
|
|
149
|
+
|
|
150
|
+
- **Closed shadow roots** are unreachable — no browser API exposes them. Open
|
|
151
|
+
roots work.
|
|
152
|
+
- **Cross-origin and same-origin iframes** are not traversed yet; only the top
|
|
153
|
+
frame is parsed.
|
|
154
|
+
- **Canvas-rendered UIs** have no DOM to read. Use a vision model there.
|
|
155
|
+
- **Labels come from the page**, so a hostile page can write anything into one.
|
|
156
|
+
Treat graph text as untrusted input — see SECURITY.md.
|
|
157
|
+
- ZeroDOM operates on a `Page` you already control. It does not bypass bot
|
|
158
|
+
detection and makes no attempt to.
|
|
159
|
+
|
|
160
|
+
## Links
|
|
161
|
+
|
|
162
|
+
- **Source, full README and benchmarks:**
|
|
163
|
+
https://github.com/DevHusnainAi/zerodom
|
|
164
|
+
- **Issues:** https://github.com/DevHusnainAi/zerodom/issues
|
|
165
|
+
- **License:** Business Source License 1.1 — free to use, including in
|
|
166
|
+
production; you may not offer ZeroDOM itself as a hosted service. Converts to
|
|
167
|
+
Apache 2.0 on 2030-08-09.
|
|
168
|
+
|