agent-first-browse 0.1.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 (162) hide show
  1. agent_first_browse-0.1.0/LICENSE +202 -0
  2. agent_first_browse-0.1.0/PKG-INFO +320 -0
  3. agent_first_browse-0.1.0/README.md +278 -0
  4. agent_first_browse-0.1.0/pyproject.toml +168 -0
  5. agent_first_browse-0.1.0/setup.cfg +4 -0
  6. agent_first_browse-0.1.0/src/a11y_parser.py +980 -0
  7. agent_first_browse-0.1.0/src/action_classifier.py +350 -0
  8. agent_first_browse-0.1.0/src/action_feedback.py +73 -0
  9. agent_first_browse-0.1.0/src/action_verifier.py +691 -0
  10. agent_first_browse-0.1.0/src/advanced_agent.py +1507 -0
  11. agent_first_browse-0.1.0/src/agent_first_browse.egg-info/PKG-INFO +320 -0
  12. agent_first_browse-0.1.0/src/agent_first_browse.egg-info/SOURCES.txt +160 -0
  13. agent_first_browse-0.1.0/src/agent_first_browse.egg-info/dependency_links.txt +1 -0
  14. agent_first_browse-0.1.0/src/agent_first_browse.egg-info/entry_points.txt +4 -0
  15. agent_first_browse-0.1.0/src/agent_first_browse.egg-info/requires.txt +17 -0
  16. agent_first_browse-0.1.0/src/agent_first_browse.egg-info/top_level.txt +56 -0
  17. agent_first_browse-0.1.0/src/app/__init__.py +11 -0
  18. agent_first_browse-0.1.0/src/app/browser_promoter/__init__.py +46 -0
  19. agent_first_browse-0.1.0/src/app/browser_promoter/browser_runtime.py +185 -0
  20. agent_first_browse-0.1.0/src/app/browser_promoter/browser_warmup.py +235 -0
  21. agent_first_browse-0.1.0/src/app/browser_promoter/cdp_human_behavior.py +173 -0
  22. agent_first_browse-0.1.0/src/app/browser_promoter/cdp_stealth_launcher.py +664 -0
  23. agent_first_browse-0.1.0/src/app/browser_promoter/dashboard.py +97 -0
  24. agent_first_browse-0.1.0/src/app/browser_promoter/database.py +500 -0
  25. agent_first_browse-0.1.0/src/app/browser_promoter/db_tools.py +56 -0
  26. agent_first_browse-0.1.0/src/app/browser_promoter/github_intelligence.py +394 -0
  27. agent_first_browse-0.1.0/src/app/browser_promoter/google_stealth_auth_graph.py +325 -0
  28. agent_first_browse-0.1.0/src/app/browser_promoter/graph.py +103 -0
  29. agent_first_browse-0.1.0/src/app/browser_promoter/marketing_engine.py +421 -0
  30. agent_first_browse-0.1.0/src/app/browser_promoter/nodes.py +817 -0
  31. agent_first_browse-0.1.0/src/app/browser_promoter/physical_input_driver.py +618 -0
  32. agent_first_browse-0.1.0/src/app/browser_promoter/playwright_human_input.py +497 -0
  33. agent_first_browse-0.1.0/src/app/browser_promoter/shadow_dom_piercer.py +148 -0
  34. agent_first_browse-0.1.0/src/app/browser_promoter/state.py +206 -0
  35. agent_first_browse-0.1.0/src/app/browser_promoter/supervisor_subgraph.py +877 -0
  36. agent_first_browse-0.1.0/src/app/browser_promoter/worker_planner.py +303 -0
  37. agent_first_browse-0.1.0/src/app/browser_promoter/zero_token_executor.py +108 -0
  38. agent_first_browse-0.1.0/src/app/call_pacing.py +32 -0
  39. agent_first_browse-0.1.0/src/app/config.py +206 -0
  40. agent_first_browse-0.1.0/src/app/logger.py +67 -0
  41. agent_first_browse-0.1.0/src/app/observability.py +140 -0
  42. agent_first_browse-0.1.0/src/brain_graph.py +1189 -0
  43. agent_first_browse-0.1.0/src/brain_state.py +308 -0
  44. agent_first_browse-0.1.0/src/campaign_memory.py +224 -0
  45. agent_first_browse-0.1.0/src/cdp_click.py +647 -0
  46. agent_first_browse-0.1.0/src/cdp_input.py +510 -0
  47. agent_first_browse-0.1.0/src/clarity.py +144 -0
  48. agent_first_browse-0.1.0/src/cognition.py +481 -0
  49. agent_first_browse-0.1.0/src/cognitive_core.py +441 -0
  50. agent_first_browse-0.1.0/src/consensus.py +323 -0
  51. agent_first_browse-0.1.0/src/content_critic.py +199 -0
  52. agent_first_browse-0.1.0/src/content_store.py +347 -0
  53. agent_first_browse-0.1.0/src/core/__init__.py +270 -0
  54. agent_first_browse-0.1.0/src/core/browser_provider.py +558 -0
  55. agent_first_browse-0.1.0/src/core/disposable.py +270 -0
  56. agent_first_browse-0.1.0/src/core/errors.py +436 -0
  57. agent_first_browse-0.1.0/src/core/observability.py +467 -0
  58. agent_first_browse-0.1.0/src/core/redaction.py +263 -0
  59. agent_first_browse-0.1.0/src/core/retries.py +345 -0
  60. agent_first_browse-0.1.0/src/core/runtime_context.py +219 -0
  61. agent_first_browse-0.1.0/src/core/session_bootstrap.py +235 -0
  62. agent_first_browse-0.1.0/src/core/settings.py +595 -0
  63. agent_first_browse-0.1.0/src/core/truncate.py +274 -0
  64. agent_first_browse-0.1.0/src/core/url_policy.py +379 -0
  65. agent_first_browse-0.1.0/src/dom_diff.py +108 -0
  66. agent_first_browse-0.1.0/src/dom_parser.py +750 -0
  67. agent_first_browse-0.1.0/src/eval_connector/__init__.py +21 -0
  68. agent_first_browse-0.1.0/src/eval_connector/cli.py +385 -0
  69. agent_first_browse-0.1.0/src/eval_connector/daemon.py +429 -0
  70. agent_first_browse-0.1.0/src/eval_connector/mcp_server.py +504 -0
  71. agent_first_browse-0.1.0/src/eval_connector/scenarios.py +327 -0
  72. agent_first_browse-0.1.0/src/eval_connector/session.py +767 -0
  73. agent_first_browse-0.1.0/src/execution_safety.py +246 -0
  74. agent_first_browse-0.1.0/src/feature_flags.py +187 -0
  75. agent_first_browse-0.1.0/src/form_engine.py +117 -0
  76. agent_first_browse-0.1.0/src/ghost_input.py +464 -0
  77. agent_first_browse-0.1.0/src/github_engagement.py +238 -0
  78. agent_first_browse-0.1.0/src/intent_journal.py +275 -0
  79. agent_first_browse-0.1.0/src/mcp_tools.py +816 -0
  80. agent_first_browse-0.1.0/src/model_registry.py +1304 -0
  81. agent_first_browse-0.1.0/src/moe_router.py +204 -0
  82. agent_first_browse-0.1.0/src/orchestrator/__init__.py +25 -0
  83. agent_first_browse-0.1.0/src/orchestrator/actions.py +170 -0
  84. agent_first_browse-0.1.0/src/orchestrator/ceo.py +298 -0
  85. agent_first_browse-0.1.0/src/orchestrator/critic.py +196 -0
  86. agent_first_browse-0.1.0/src/orchestrator/critic_v12.py +535 -0
  87. agent_first_browse-0.1.0/src/orchestrator/event_log.py +196 -0
  88. agent_first_browse-0.1.0/src/orchestrator/executor.py +319 -0
  89. agent_first_browse-0.1.0/src/orchestrator/spawner.py +166 -0
  90. agent_first_browse-0.1.0/src/orchestrator/state.py +157 -0
  91. agent_first_browse-0.1.0/src/outcome_judge.py +294 -0
  92. agent_first_browse-0.1.0/src/overlay_detector.py +244 -0
  93. agent_first_browse-0.1.0/src/overwatch.py +1021 -0
  94. agent_first_browse-0.1.0/src/paths.py +17 -0
  95. agent_first_browse-0.1.0/src/perception_engine.py +275 -0
  96. agent_first_browse-0.1.0/src/platform_detect.py +42 -0
  97. agent_first_browse-0.1.0/src/prm_critic.py +427 -0
  98. agent_first_browse-0.1.0/src/proxy_manager.py +271 -0
  99. agent_first_browse-0.1.0/src/reality.py +265 -0
  100. agent_first_browse-0.1.0/src/run.py +218 -0
  101. agent_first_browse-0.1.0/src/run_objective.py +8 -0
  102. agent_first_browse-0.1.0/src/run_prompt.py +27 -0
  103. agent_first_browse-0.1.0/src/run_v16.py +83 -0
  104. agent_first_browse-0.1.0/src/skill_memory.py +504 -0
  105. agent_first_browse-0.1.0/src/skills/__init__.py +13 -0
  106. agent_first_browse-0.1.0/src/skills/base.py +70 -0
  107. agent_first_browse-0.1.0/src/skills/browser_extract.py +272 -0
  108. agent_first_browse-0.1.0/src/skills/browser_interact.py +221 -0
  109. agent_first_browse-0.1.0/src/skills/browser_navigate.py +81 -0
  110. agent_first_browse-0.1.0/src/stagnation.py +93 -0
  111. agent_first_browse-0.1.0/src/subgoal_lock.py +139 -0
  112. agent_first_browse-0.1.0/src/target_lock.py +174 -0
  113. agent_first_browse-0.1.0/src/twitter_thread.py +250 -0
  114. agent_first_browse-0.1.0/src/v2_engine/__init__.py +67 -0
  115. agent_first_browse-0.1.0/src/v2_engine/actions.py +379 -0
  116. agent_first_browse-0.1.0/src/v2_engine/graph_policy.py +74 -0
  117. agent_first_browse-0.1.0/src/v2_engine/metrics.py +123 -0
  118. agent_first_browse-0.1.0/src/v2_engine/perception.py +667 -0
  119. agent_first_browse-0.1.0/src/verification_engine.py +129 -0
  120. agent_first_browse-0.1.0/src/virtual_display.py +143 -0
  121. agent_first_browse-0.1.0/src/vision_consult.py +282 -0
  122. agent_first_browse-0.1.0/src/web_dreamer.py +770 -0
  123. agent_first_browse-0.1.0/src/workers/__init__.py +1 -0
  124. agent_first_browse-0.1.0/src/workers/base_worker.py +1070 -0
  125. agent_first_browse-0.1.0/tests/test_a11y_parser.py +509 -0
  126. agent_first_browse-0.1.0/tests/test_antibot_v22.py +98 -0
  127. agent_first_browse-0.1.0/tests/test_brain_graph_integration.py +425 -0
  128. agent_first_browse-0.1.0/tests/test_brain_v16.py +55 -0
  129. agent_first_browse-0.1.0/tests/test_capability_v24.py +210 -0
  130. agent_first_browse-0.1.0/tests/test_cognition_v18.py +234 -0
  131. agent_first_browse-0.1.0/tests/test_consensus_v27.py +222 -0
  132. agent_first_browse-0.1.0/tests/test_core_browser_provider.py +331 -0
  133. agent_first_browse-0.1.0/tests/test_core_errors_and_retries.py +453 -0
  134. agent_first_browse-0.1.0/tests/test_core_observability.py +299 -0
  135. agent_first_browse-0.1.0/tests/test_core_runtime_context.py +340 -0
  136. agent_first_browse-0.1.0/tests/test_core_safety_and_payloads.py +394 -0
  137. agent_first_browse-0.1.0/tests/test_core_session_bootstrap.py +206 -0
  138. agent_first_browse-0.1.0/tests/test_core_settings.py +266 -0
  139. agent_first_browse-0.1.0/tests/test_eval_connector_cli.py +202 -0
  140. agent_first_browse-0.1.0/tests/test_eval_connector_core.py +229 -0
  141. agent_first_browse-0.1.0/tests/test_eval_connector_mcp.py +228 -0
  142. agent_first_browse-0.1.0/tests/test_failover_v17.py +266 -0
  143. agent_first_browse-0.1.0/tests/test_form_fill.py +136 -0
  144. agent_first_browse-0.1.0/tests/test_guardrails.py +402 -0
  145. agent_first_browse-0.1.0/tests/test_guidance_v27.py +106 -0
  146. agent_first_browse-0.1.0/tests/test_handoff_v26.py +150 -0
  147. agent_first_browse-0.1.0/tests/test_intent_journal_v29.py +215 -0
  148. agent_first_browse-0.1.0/tests/test_perception_engine_v29.py +227 -0
  149. agent_first_browse-0.1.0/tests/test_perception_v19.py +338 -0
  150. agent_first_browse-0.1.0/tests/test_phase23_v29.py +203 -0
  151. agent_first_browse-0.1.0/tests/test_phase_a_v29.py +203 -0
  152. agent_first_browse-0.1.0/tests/test_phase_b_v29.py +180 -0
  153. agent_first_browse-0.1.0/tests/test_read_only.py +37 -0
  154. agent_first_browse-0.1.0/tests/test_reality_v29.py +233 -0
  155. agent_first_browse-0.1.0/tests/test_security_v34.py +341 -0
  156. agent_first_browse-0.1.0/tests/test_selfhealing.py +89 -0
  157. agent_first_browse-0.1.0/tests/test_session_guard.py +87 -0
  158. agent_first_browse-0.1.0/tests/test_subgoal_lock_v29.py +100 -0
  159. agent_first_browse-0.1.0/tests/test_v151_blacklist.py +55 -0
  160. agent_first_browse-0.1.0/tests/test_v2_engine.py +452 -0
  161. agent_first_browse-0.1.0/tests/test_verification_v20.py +264 -0
  162. agent_first_browse-0.1.0/tests/test_vision_v21.py +189 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,320 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-first-browse
3
+ Version: 0.1.0
4
+ Summary: Fast, token-efficient AI browser agent that sees, clicks, types, and completes real web tasks autonomously - with native MCP & CLI control.
5
+ Author: SandeepAi369
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://xel-studio.vercel.app
8
+ Project-URL: Repository, https://github.com/SandeepAi369/Agent-first-browse
9
+ Project-URL: Documentation, https://github.com/SandeepAi369/Agent-first-browse/blob/main/docs/EVAL_CONNECTOR.md
10
+ Project-URL: Issues, https://github.com/SandeepAi369/Agent-first-browse/issues
11
+ Keywords: ai-agents,browser-automation,browser-agent,browser-use,playwright,langgraph,mcp,mcp-server,model-context-protocol,computer-use,web-agent,autonomous-agents,agentic-ai,llm-agents,web-automation,accessibility-tree,chrome-devtools-protocol,chromium,python,stealth-browser
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: Software Development :: Testing
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: pydantic>=2.12.0
26
+ Requires-Dist: langgraph>=1.0.0
27
+ Requires-Dist: langgraph-checkpoint-sqlite>=3.0.0
28
+ Requires-Dist: langchain>=1.0.0
29
+ Requires-Dist: langchain-openai>=1.0.0
30
+ Requires-Dist: langchain-google-genai>=2.1.0
31
+ Requires-Dist: langsmith>=0.4.0
32
+ Requires-Dist: playwright>=1.55.0
33
+ Requires-Dist: playwright-stealth>=2.0.0
34
+ Requires-Dist: python-dotenv>=1.1.0
35
+ Requires-Dist: httpx>=0.27.0
36
+ Provides-Extra: dev
37
+ Requires-Dist: pytest>=8.0; extra == "dev"
38
+ Requires-Dist: pytest-asyncio>=0.25.0; extra == "dev"
39
+ Requires-Dist: mypy>=1.15; extra == "dev"
40
+ Requires-Dist: ruff>=0.11.0; extra == "dev"
41
+ Dynamic: license-file
42
+
43
+ <div align="center">
44
+
45
+ # ๐ŸŒ Agent First Browse
46
+
47
+ **Fast, token-efficient autonomous browser control for AI agents.**
48
+ *Accessibility-tree-first perception ยท LangGraph verification ยท Native zero-API MCP & CLI*
49
+
50
+ <p>
51
+ <a href="https://pypi.org/project/agent-first-browse/"><img src="https://img.shields.io/pypi/v/agent-first-browse?style=flat-square&color=3776AB&label=PyPI" alt="PyPI"></a>
52
+ <a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+"></a>
53
+ <a href="https://langchain-ai.github.io/langgraph/"><img src="https://img.shields.io/badge/LangGraph-1.x-FF6B35?style=flat-square" alt="LangGraph 1.x"></a>
54
+ <a href="https://playwright.dev/python/"><img src="https://img.shields.io/badge/Playwright-1.55%2B-2EAD33?style=flat-square&logo=playwright&logoColor=white" alt="Playwright 1.55+"></a>
55
+ <a href="https://github.com/SandeepAi369/Agent-first-browse/blob/main/docs/EVAL_CONNECTOR.md"><img src="https://img.shields.io/badge/MCP-stdio%20%2B%20CLI-7C3AED?style=flat-square" alt="MCP Ready"></a>
56
+ <a href="https://github.com/SandeepAi369/Agent-first-browse/blob/main/docs/TEST_COVERAGE_MATRIX.md"><img src="https://img.shields.io/badge/Tests-528%20passing-10B981?style=flat-square" alt="528 Passing Tests"></a>
57
+ <a href="https://github.com/SandeepAi369/Agent-first-browse/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache--2.0-0EA5E9?style=flat-square" alt="Apache-2.0 License"></a>
58
+ </p>
59
+
60
+ <p>
61
+ <a href="#live-demo">Demo</a> ยท
62
+ <a href="#why-agent-first-browse">Capabilities</a> ยท
63
+ <a href="#architecture">Architecture</a> ยท
64
+ <a href="#verified-benchmarks">Benchmarks</a> ยท
65
+ <a href="#quick-start">Quick Start</a> ยท
66
+ <a href="#documentation">Docs</a>
67
+ </p>
68
+
69
+ </div>
70
+
71
+ ---
72
+
73
+ ## Live Demo
74
+
75
+ <div align="center">
76
+
77
+ [![Agent First Browse โ€” Live Autonomous Checkout Demo](https://raw.githubusercontent.com/SandeepAi369/Agent-first-browse/main/docs/assets/demo.gif)](https://github.com/SandeepAi369/Agent-first-browse/blob/main/docs/assets/raw/agent_first_browse_demo_1280x720.webm)
78
+
79
+ <sub>
80
+ <strong>Prompt:</strong> <em>"Sort products Low โ†’ High, add the 2 cheapest items to cart, and complete checkout"</em><br>
81
+ Live <code>perceive_v2</code> perception (<strong>136.9 ms/step</strong> avg ยท <strong>~119 tokens/step</strong>) ยท Smooth Bรฉzier cursor ยท Character-by-character input<br>
82
+ <a href="https://github.com/SandeepAi369/Agent-first-browse/blob/main/docs/assets/raw/agent_first_browse_demo_1280x720.webm">Watch full 1280ร—720 HD recording (WebM)</a> ยท
83
+ <a href="https://github.com/SandeepAi369/Agent-first-browse/blob/main/scripts/record_visual_demo.py">Demo script</a>
84
+ </sub>
85
+
86
+ </div>
87
+
88
+ <br>
89
+
90
+ | โšก Perception Speed | ๐Ÿช™ Prompt Efficiency | ๐Ÿ”Œ Zero-API Agent Control | โœ… Automated Verification |
91
+ | :---: | :---: | :---: | :---: |
92
+ | **12.0ร— faster** | **54.8% fewer tokens** | **Native MCP + CLI** | **528 passing tests** |
93
+ | `96.8 ms` avg vs `1,164 ms` legacy | Up to **95% saved** behind modals | 7 stdio tools + `0600` Unix daemon | `ruff`, `mypy`, guardrails & Chromium CI |
94
+
95
+ ---
96
+
97
+ ## Why Agent First Browse?
98
+
99
+ Most browser agents burn thousands of tokens per step on raw DOM dumps, sleep on fixed timers, or click stale coordinates behind overlays. **Agent First Browse** treats the browser as a structured, verifiable environment for AI agents:
100
+
101
+ | Pillar | How It Works |
102
+ |---|---|
103
+ | **โšก Adaptive DOM Settle** | `MutationObserver` quiet-window settle replaces rigid 1.5s sleeps โ€” cutting perception latency by **10โ€“12ร—** while waiting cleanly for SPA renders. |
104
+ | **๐ŸŽฏ Paint-Order Occlusion Pruning** | Live `elementFromPoint` + Shadow DOM hit-testing removes background links trapped behind modals, cookie walls, and overlays (up to **95% token savings**). |
105
+ | **๐Ÿ“‰ Incremental Delta Snapshots** | Consecutive same-URL steps emit only `+ADDED` / `~CHANGED` / `-REMOVED` controls alongside a compact ref roster (**35โ€“79% fewer prompt tokens**). |
106
+ | **๐ŸŒณ Tier-2 Accessibility-Tree Rescue** | Automatically escalates to CDP/Playwright Accessibility Trees whenever Tier-1 DOM scans go sparse (`< 2` elements) on custom ARIA web components. |
107
+ | **๐Ÿ” Stale-Ref Rebind & 4-Tier CDP** | Verifies live `window.__aid` handles, semantically rebinds buttons moved by SPA re-renders, and executes clicks/typing via trusted CDP with React-reversion recovery. |
108
+ | **๐Ÿ›ก๏ธ Defense-in-Depth Safety** | Masks passwords, OTPs, PINs, and cards before they reach prompts or logs; enforces RFC 6890 SSRF URL policies, typed errors, and full-jitter retries (`src/core/`). |
109
+
110
+ ---
111
+
112
+ ## Architecture
113
+
114
+ Drive real Chromium either **autonomously** through the LangGraph verification brain or **directly from any AI coding agent** (Antigravity, Claude Code, Cursor, VS Code, Gemini CLI) with zero external LLM API keys:
115
+
116
+ ```mermaid
117
+ flowchart LR
118
+ subgraph Entry["Entry Surfaces"]
119
+ E1["Autonomous Brain\nLangGraph StateGraph"]
120
+ E2["External AI Agent\nNative MCP stdio or CLI"]
121
+ end
122
+
123
+ subgraph Perception["V2 Perception Pipeline"]
124
+ P1["Adaptive Settle\nMutationObserver"]
125
+ P2["DOM + Tier-2 A11y\nSecret Redaction"]
126
+ P3["Occlusion Filter\nPaint-Order Hit-Test"]
127
+ P4["Delta Compressor\nCompact Ref Roster"]
128
+ P1 --> P2 --> P3 --> P4
129
+ end
130
+
131
+ subgraph Execution["Verification and Action Engine"]
132
+ X1["Overwatch Gate\nL1-L5 Grounding and Reality"]
133
+ X2["Stale-Ref Rebind\n4-Tier CDP + Stealth Chromium"]
134
+ X1 --> X2
135
+ end
136
+
137
+ subgraph Core["Shared Core Primitives"]
138
+ C1["URL Policy and Redaction\nTyped Errors and Retries\nContextVar DI and Telemetry"]
139
+ end
140
+
141
+ E1 --> P1
142
+ E2 --> P1
143
+ P4 --> X1
144
+ X2 -. "Next state" .-> P1
145
+ Core -. "Guards and observes" .-> Execution
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Verified Benchmarks
151
+
152
+ Measured on live **headed Chromium** (`headless=False`, zero external LLM API keys, AI agent acting directly as the decision-making brain across live websites and diagnostic stress scenarios):
153
+
154
+ | Scenario | Legacy Baseline | V2 Engine | Measured Impact |
155
+ |---|---|---|---|
156
+ | **Hacker News** (`news.ycombinator.com`) | `1,528 ms` ยท `~2,194 tok` | `153 ms` ยท `~1,419 โ†’ 482 tok` | **10.0ร— faster** ยท **35โ€“78% fewer tokens** |
157
+ | **Blocking Modal** (`modal_occlusion`) | `1,520 ms` ยท `~621 tok` (46 els) | `143 ms` ยท `~31 tok` (2 els) | **10.7ร— faster** ยท **95.0% fewer tokens** (`44` pruned) |
158
+ | **SPA Mid-Step Rerender** (`spa_rerender`) | โŒ **FAIL** (clicked stale coords) | โœ… **PASS** (`1,676 ms`) | **Live stale-ref semantic recovery** |
159
+ | **Custom ARIA Widgets** (`sparse_aria`) | `0` elements (blind) | `4` elements (`tier=2` A11y) | **Automatic Tier-2 A11y escalation** |
160
+ | **Cumulative Session Average** | **`1,164.4 ms` ยท `754.2 tok/step`** | **`96.8 ms` ยท `341.1 tok/step`** | **12.0ร— faster ยท 54.8% fewer tokens/step** |
161
+
162
+ <details>
163
+ <summary><strong>View full 7-scenario headed benchmark matrix</strong></summary>
164
+
165
+ <br>
166
+
167
+ | Test | Legacy (`--mode legacy`) | V2 (`--mode v2`) | Gain |
168
+ |---|---|---|---|
169
+ | `the-internet.herokuapp.com/login` (full โ†’ delta) | `1,527 ms` / `~113โ€“122 tok` | `140โ€“148 ms` / `~55โ€“71 tok` | **10.3โ€“10.8ร— faster**, **42โ€“51% fewer tokens** |
170
+ | `news.ycombinator.com` (Step 1 full / Step 2 delta) | `1,524โ€“1,531 ms` / `~2,194 tok` | `151โ€“155 ms` / `~1,419 โ†’ 482 tok` | **9.9โ€“10.1ร— faster**, **35โ€“78% fewer tokens** |
171
+ | `modal_occlusion` (blocking pop-up) | `1,520 ms` / `~621 tok` (46 els, 44 blocked) | `143 ms` / `~31 tok` (2 dialog btns) | **10.7ร— faster**, **95.0% fewer tokens**, **44 occluded pruned** |
172
+ | `spa_rerender` (shifted button click) | **FAIL** (`3,080 ms`, clicked stale coords) | **PASS** (`1,676 ms`, rebound to moved btn) | **Stale-ref semantic recovery** |
173
+ | `sparse_aria` (custom ARIA roles) | `0` elements found (blind) | `4` elements found (`tier=2` A11y) | **Automatic Tier-2 A11y rescue** |
174
+ | `multistep_form` (Step 2 review reveal) | `1,517 ms` / `~540 tok` (secret masked) | `141 ms` / `~256 tok` (`delta`, secret masked) | **10.8ร— faster**, **52.6% fewer tokens** |
175
+ | `a11y_visibility` (hidden ghosts & hints) | `1,515 ms` / `~91 tok` | `138 ms` / `~60 tok` | **11.0ร— faster**, **34.1% fewer tokens** |
176
+
177
+ </details>
178
+
179
+ ---
180
+
181
+ ## Quick Start
182
+
183
+ Requires **Python 3.11+** on Linux, WSL, or macOS.
184
+
185
+ ```bash
186
+ # Install from PyPI
187
+ pip install agent-first-browse && python -m playwright install chromium
188
+
189
+ # Or install from source
190
+ git clone https://github.com/SandeepAi369/Agent-first-browse.git && cd Agent-first-browse
191
+ python3 -m venv .venv && source .venv/bin/activate
192
+ pip install -e . && python -m playwright install chromium
193
+ ```
194
+
195
+ ### Run Your First Task
196
+
197
+ ```bash
198
+ # Autonomous LangGraph run (configure keys once via: cp .env.example .env)
199
+ agent-first-browse run --mode v2 "Open https://news.ycombinator.com and find the top 3 stories"
200
+ ```
201
+
202
+ Want **zero external API keys**? Connect Antigravity, Claude Code, Cursor, VS Code, or Gemini CLI directly via native MCP or the stateful CLI daemon:
203
+
204
+ <details>
205
+ <summary><strong>๐Ÿ”Œ Connect via Native MCP Server (<code>agent-eval-mcp</code> โ€” 7 tools, zero API keys)</strong></summary>
206
+
207
+ <br>
208
+
209
+ Copy [`.mcp.json.example`](https://github.com/SandeepAi369/Agent-first-browse/blob/main/.mcp.json.example) into your MCP client config:
210
+
211
+ ```json
212
+ {
213
+ "mcpServers": {
214
+ "agent-first-browse-eval": {
215
+ "command": ".venv/bin/python",
216
+ "args": ["-m", "eval_connector.mcp_server"],
217
+ "env": {
218
+ "PYTHONPATH": "src"
219
+ }
220
+ }
221
+ }
222
+ }
223
+ ```
224
+
225
+ | Tool | Purpose |
226
+ |---|---|
227
+ | `eval_start` | Launch a `legacy`, `v2`, or twin `pair` Chromium session (`headless: true/false`). |
228
+ | `eval_perceive` | Run live perception and return compact ref elements + step telemetry. |
229
+ | `eval_act` | Execute `goto`, `click`, `type`, `hover`, `select_option`, `press_enter`, `press_key`, `scroll`, or `wait`. |
230
+ | `eval_compare` | Diff `legacy` vs `v2` sessions side-by-side (latency, tokens, occlusion, visibility). |
231
+ | `eval_screenshot` | Save a viewport or full-page PNG screenshot to disk. |
232
+ | `eval_metrics` | Export cumulative Markdown/JSON telemetry and scenario catalog. |
233
+ | `eval_stop` | Close one session or shut down all active sessions cleanly. |
234
+
235
+ </details>
236
+
237
+ <details>
238
+ <summary><strong>๐Ÿ’ป Drive via Stateful CLI Daemon (<code>agent-eval</code> โ€” zero API keys)</strong></summary>
239
+
240
+ <br>
241
+
242
+ ```bash
243
+ # Start paired Legacy + V2 sessions on any live URL (add --headed to watch on screen)
244
+ agent-eval start-pair live --url https://news.ycombinator.com --headed
245
+
246
+ # Compare speed, tokens, occlusion pruning, and element visibility side-by-side
247
+ agent-eval compare live_legacy live_v2
248
+
249
+ # Step-by-step perception and actions
250
+ agent-eval perceive live_v2
251
+ agent-eval act live_v2 click e1 --auto-perceive
252
+ agent-eval screenshot live_v2
253
+
254
+ # Export cumulative report and shut down cleanly
255
+ agent-eval report --json-out eval_report.json
256
+ agent-eval stop --daemon
257
+ ```
258
+
259
+ *(Without `pip install -e .`, replace `agent-eval` with `.venv/bin/python scripts/agent_eval.py`.)*
260
+
261
+ </details>
262
+
263
+ <details>
264
+ <summary><strong>โš™๏ธ Additional Autonomous CLI Options & Headed Xvfb Setup</strong></summary>
265
+
266
+ <br>
267
+
268
+ ```bash
269
+ # Optional on headless Linux/WSL for stealth headed display inside Xvfb
270
+ sudo apt-get install -y xvfb
271
+
272
+ # Run with baseline legacy mode for side-by-side comparison
273
+ ./agent.sh --mode legacy "Open https://news.ycombinator.com and find the top 3 stories"
274
+
275
+ # Invoke Python directly (add --headless to run without a display)
276
+ .venv/bin/python src/run_v16.py run --mode v2 "Log in to https://the-internet.herokuapp.com/login and verify the secure area"
277
+ ```
278
+
279
+ </details>
280
+
281
+ <details>
282
+ <summary><strong>๐Ÿงช Quality Gates, Guardrails & Test Suite</strong></summary>
283
+
284
+ <br>
285
+
286
+ ```bash
287
+ # Full offline unit + local-Chromium test suite (528 tests)
288
+ .venv/bin/pytest -q
289
+
290
+ # Architectural guardrails (frozen modules, universal-only perception, exports, secrets, test hygiene)
291
+ .venv/bin/python scripts/check_guardrails.py --strict-test-hygiene
292
+
293
+ # Scoped lint & progressive typecheck (mirrors GitHub Actions CI)
294
+ .venv/bin/ruff check src/core src/v2_engine src/eval_connector scripts/check_guardrails.py
295
+ .venv/bin/mypy src/core src/v2_engine src/eval_connector scripts/check_guardrails.py
296
+
297
+ # Built-in side-by-side Legacy vs V2 local stress benchmark (zero API keys)
298
+ .venv/bin/python scripts/benchmark_v2_vs_legacy.py --suite local
299
+ ```
300
+
301
+ </details>
302
+
303
+ ---
304
+
305
+ ## Documentation
306
+
307
+ | Guide | Contents |
308
+ |---|---|
309
+ | [`AGENTS.md`](https://github.com/SandeepAi369/Agent-first-browse/blob/main/AGENTS.md) | Engineering handbook, package boundaries, frozen-file rules, and verification commands. |
310
+ | [`docs/EVAL_CONNECTOR.md`](https://github.com/SandeepAi369/Agent-first-browse/blob/main/docs/EVAL_CONNECTOR.md) | Complete Zero-API MCP + CLI connector guide, scenarios, and headed benchmark results. |
311
+ | [`docs/TEST_COVERAGE_MATRIX.md`](https://github.com/SandeepAi369/Agent-first-browse/blob/main/docs/TEST_COVERAGE_MATRIX.md) | Subsystem-by-layer test coverage rollup and CI gate mapping. |
312
+ | [`docs/V2_ECOSYSTEM_AUDIT_2026.md`](https://github.com/SandeepAi369/Agent-first-browse/blob/main/docs/V2_ECOSYSTEM_AUDIT_2026.md) | V2 perception & resilient action engine design rationale. |
313
+ | [`docs/V29_OVERHAUL.md`](https://github.com/SandeepAi369/Agent-first-browse/blob/main/docs/V29_OVERHAUL.md) | V29 cognitive reliability layers (Reality Monitor, Intent Journal, Sub-Goal Lock). |
314
+
315
+ ---
316
+
317
+ ## License & Support
318
+
319
+ - Licensed under the **Apache License 2.0** โ€” see [`LICENSE`](https://github.com/SandeepAi369/Agent-first-browse/blob/main/LICENSE).
320
+ - If you find **Agent First Browse** useful, consider starring the repo or supporting ongoing open-source development via [GitHub Sponsors](https://github.com/sponsors/SandeepAi369).