gossamer-browser 0.2.1__py3-none-win_amd64.whl

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.
@@ -0,0 +1,28 @@
1
+ """Console wrapper for the bundled ``gossamer-browser`` sidecar binary."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ import subprocess
7
+ import sys
8
+ from importlib.resources import as_file, files
9
+
10
+
11
+ def binary_name() -> str:
12
+ """Return the bundled executable name for this platform."""
13
+ return "gossamer-browser.exe" if os.name == "nt" else "gossamer-browser"
14
+
15
+
16
+ def binary_path():
17
+ """Return a context manager yielding the bundled executable path."""
18
+ return as_file(files(__name__).joinpath("bin", binary_name()))
19
+
20
+
21
+ def main() -> int:
22
+ """Run the sidecar with inherited stdin/stdout/stderr and its exit status."""
23
+ with binary_path() as executable:
24
+ command = [os.fspath(executable), *sys.argv[1:]]
25
+ if os.name == "nt":
26
+ return subprocess.call(command)
27
+ os.execv(command[0], command)
28
+ return 0
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: gossamer_browser/bin/gossamer-browser.exe
3
+ size: 75764736 bytes
4
+ sha256: bf95c3d1904b37fc01fbeb1b10c85ecadd536b64f22b3b58ca572f56409f32c1
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.3
2
+ Name: gossamer-browser
3
+ Version: 0.2.1
4
+ Summary: Optional browser_oxide renderer sidecar for gossamer
5
+ Home-page: https://github.com/opticsWolf/gossamer
6
+ License: MIT OR Apache-2.0
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.10
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Rust
11
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
12
+ Description-Content-Type: text/markdown
13
+
14
+ # gossamer-browser sidecar
15
+
16
+ Optional one-shot renderer for gossamer's `browser` / `browser-only` fetch
17
+ strategies. The binary embeds the `browser_oxide` engine (a from-scratch Rust
18
+ browser with V8 and BoringSSL); the main `gossamer` binary never links it.
19
+
20
+ ## Why a sidecar
21
+
22
+ `browser_oxide` can abort the process on some cold renders. Keeping it in a
23
+ separate executable means a native abort only kills the renderer, not the CLI
24
+ or MCP server. It also keeps the optional browser dependency out of the main
25
+ build and lets each platform ship a prebuilt renderer.
26
+
27
+ ## Build
28
+
29
+ `browser_oxide` builds from source and needs:
30
+
31
+ - Rust 1.97+ (the crate declares 1.91)
32
+ - NASM (BoringSSL assembly)
33
+ - LLVM/libclang (`LIBCLANG_PATH`) for bindgen
34
+ - CMake, a C/C++ toolchain
35
+ - Linux: `libfreetype-dev` and `libfontconfig-dev` at link time
36
+ - macOS arm64: `brew install nasm llvm cmake ninja pkg-config freetype
37
+ fontconfig`, then set `LIBCLANG_PATH=$(brew --prefix llvm)/lib`
38
+
39
+ ```bash
40
+ cd rust/browser-sidecar
41
+ cargo build --release --locked
42
+ ```
43
+
44
+ The crate is deliberately **not** a member of the main `rust/` workspace: its
45
+ native dependency tree is large and would make the normal workspace gates
46
+ require the browser toolchain. It has its own `Cargo.lock`.
47
+
48
+ GitHub Actions builds Linux x86_64, Windows x86_64, and macOS arm64.
49
+ The combined `Release` workflow (`.github/workflows/release.yml`) handles
50
+ `browser-sidecar-v*` tags: it builds the binaries, packages platform wheels,
51
+ publishes them to PyPI as `gossamer-browser`, and attaches both the wheels and
52
+ raw binaries to the GitHub release. `.github/workflows/browser-sidecar.yml`
53
+ keeps branch/manual artifact builds for iteration. Artifacts are retained for
54
+ 30 days under names such as `gossamer-browser-macos-arm64` and
55
+ `gossamer-browser-linux-x86_64`.
56
+
57
+ Tag pushes are what trigger the release workflow; an existing tag does not
58
+ re-run it. Bump the sidecar version and push a fresh `browser-sidecar-v*`
59
+ tag after changing the workflow or packaging.
60
+
61
+ ## Rust install
62
+
63
+ The sidecar is published on crates.io as `gossamer-browser`. A source build
64
+ links V8/BoringSSL and needs the native toolchain listed above; `cargo install`
65
+ therefore compiles the full engine locally. `cargo-binstall` instead downloads
66
+ the prebuilt binary from the matching GitHub release:
67
+
68
+ ```bash
69
+ cargo binstall gossamer-browser
70
+ # or, with the native toolchain installed:
71
+ cargo install gossamer-browser
72
+ ```
73
+
74
+ The release assets are named by Rust target triple:
75
+
76
+ - `gossamer-browser-x86_64-unknown-linux-gnu`
77
+ - `gossamer-browser-x86_64-pc-windows-msvc.exe`
78
+ - `gossamer-browser-aarch64-apple-darwin`
79
+
80
+ ## PyPI wheel
81
+
82
+ The sidecar is also published as a platform wheel:
83
+
84
+ ```bash
85
+ pip install gossamer-browser
86
+ ```
87
+
88
+ The wheel installs the `gossamer-browser` console script plus the bundled
89
+ native binary. It is the same executable the Rust CLI discovers, so an
90
+ activated virtualenv normally puts it on `PATH`; otherwise point
91
+ `GOSSAMER_BROWSER_SIDECAR` at the installed script or binary.
92
+
93
+ Wheel tags are generated for Linux (`manylinux_2_35_x86_64`), Windows
94
+ (`win_amd64`), and macOS (`macosx_11_0_arm64`). macOS Intel x86_64 is not
95
+ built.
96
+
97
+ ## Protocol
98
+
99
+ The sidecar reads one JSON object from stdin (or from its first argument) and
100
+ writes one compact JSON object to stdout. Diagnostics go to stderr.
101
+
102
+ Request:
103
+
104
+ ```json
105
+ {"url": "https://example.com", "profile": "chrome", "max_iterations": 5}
106
+ ```
107
+
108
+ - `url` is required and must be `http` or `https`.
109
+ - `profile` accepts `chrome`, `firefox`, `pixel`, `iphone`, or a concrete
110
+ `browser_oxide` preset such as `chrome_148_windows`. Omit it to use the
111
+ platform default.
112
+ - `max_iterations` is clamped to `1..=20` (default `5`).
113
+
114
+ Success (`exit 0`):
115
+
116
+ ```json
117
+ {"ok": true, "url": "https://example.com/", "title": "Example", "html": "<html>…", "html_chars": 1234, "verdict": "Pass"}
118
+ ```
119
+
120
+ Handled failure (`exit 1`):
121
+
122
+ ```json
123
+ {"ok": false, "error": "Anti-bot challenge detected (EdgeBlock)", "error_type": "challenge", "verdict": "EdgeBlock"}
124
+ ```
125
+
126
+ Invalid request (`exit 2`):
127
+
128
+ ```json
129
+ {"ok": false, "error": "invalid request JSON: missing field `url`", "error_type": "InvalidRequest"}
130
+ ```
131
+
132
+ A native abort/panic has no JSON payload; the parent sees the non-zero exit
133
+ code and stderr tail.
134
+
135
+ ## Parent integration
136
+
137
+ The CLI locates the renderer in this order:
138
+
139
+ 1. `GOSSAMER_BROWSER_SIDECAR` (an absolute path, or a bare command name on
140
+ `PATH`)
141
+ 2. the directory containing the running `gossamer` executable
142
+ 3. `PATH`
143
+
144
+ Release assets use Rust target-triple names (see above). Rename a downloaded
145
+ macOS/Linux asset to `gossamer-browser` (or point `GOSSAMER_BROWSER_SIDECAR` at
146
+ it) so the executable-directory lookup and `PATH` lookup find it. The PyPI
147
+ wheel already installs the correctly named executable. macOS binaries are
148
+ ad-hoc signed in CI but not notarized; if Gatekeeper quarantines a downloaded
149
+ copy, remove the quarantine attribute (`xattr -d com.apple.quarantine
150
+ gossamer-browser`) or build it locally.
151
+
152
+ Other controls:
153
+
154
+ - `GOSSAMER_BROWSER_PROFILE` (default `chrome`)
155
+ - `GOSSAMER_BROWSER_TIMEOUT` (seconds, default `45`, floor `5`)
156
+
157
+ If no renderer is found, `browser-only` keeps the legacy
158
+ `browser_oxide is not installed` error and `browser-first` falls back to the
159
+ static fetch. Browser escalation policy is still default-off per ADR-019.
160
+
161
+ ## Security boundary
162
+
163
+ The sidecar validates only the initial URL scheme. The parent checks the
164
+ initial URL with the normal SSRF policy before spawning it, but **subresource
165
+ requests made by the page are not intercepted**. Do not enable automatic
166
+ browser escalation for untrusted URLs until SSRF-safe request interception
167
+ exists. The sidecar does not solve CAPTCHAs, click consent UI, use real browser
168
+ profiles, or run headful.
@@ -0,0 +1,8 @@
1
+ gossamer_browser/__init__.py,sha256=j098OptjKqMVyTgXuZYvo5nIL_0csDyOpwzcqW6mryo,881
2
+ gossamer_browser/bin/gossamer-browser.exe,sha256=v5XD0ZBLN_wB--sbEMheyt1Ta2TyKztYylcvVkCfMsE,75764736
3
+ gossamer_browser-0.2.1.dist-info/METADATA,sha256=s7_zL3nhGog0gn7sR8BxmmXzoN2z0LFYF5_3gPGbs4w,6307
4
+ gossamer_browser-0.2.1.dist-info/WHEEL,sha256=N_joUnRcAfqlF5JsH6oB7U_SYm17XZzYeX6Fvdt_qHU,104
5
+ gossamer_browser-0.2.1.dist-info/entry_points.txt,sha256=_LqW4UW0GeqiOYpY4tpeU99Vbjn1wyJ0AsJY6yHBYm8,59
6
+ gossamer_browser-0.2.1.dist-info/top_level.txt,sha256=yXj2B8VGf5UfggEeu1zkQlRz83TrzATRZ9ONmwMPcdA,17
7
+ gossamer_browser-0.2.1.dist-info/licenses/LICENSE,sha256=rVAMKsYkl3H1vRnCspluuTAOGqVdXkNI6Arx1Jh7oEs,10497
8
+ gossamer_browser-0.2.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: gossamer-browser-packaging
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ gossamer-browser = gossamer_browser:main
@@ -0,0 +1,194 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 gossamer contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ Apache License
26
+ Version 2.0, January 2004
27
+ http://www.apache.org/licenses/
28
+
29
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
30
+
31
+ 1. Definitions.
32
+
33
+ "License" shall mean the terms and conditions for use, reproduction,
34
+ and distribution as defined by Sections 1 through 9 of this document.
35
+
36
+ "Licensor" shall mean the copyright owner or entity authorized by
37
+ the copyright owner that is granting the License.
38
+
39
+ "Legal Entity" shall mean the union of the acting entity and all
40
+ other entities that control, are controlled by, or are under common
41
+ control with that entity. For the purposes of this definition,
42
+ "control" means (i) the power, direct or indirect, to cause the
43
+ direction or management of such entity, whether by contract or
44
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
45
+ outstanding shares, or (iii) beneficial ownership of such entity.
46
+
47
+ "You" (or "Your") shall mean an individual or Legal Entity
48
+ exercising permissions granted by this License.
49
+
50
+ "Source" form shall mean the preferred form for making modifications,
51
+ including but not limited to software source code, documentation
52
+ source, and configuration files.
53
+
54
+ "Object" form shall mean any form resulting from mechanical
55
+ transformation or translation of a Source form, including but
56
+ not limited to compiled object code, generated documentation,
57
+ and conversions to other media types.
58
+
59
+ "Work" shall mean the work of authorship, whether in Source or
60
+ Object form, made available under the License, as indicated by a
61
+ copyright notice that is included in or attached to the work
62
+ (an example is provided in the Appendix below).
63
+
64
+ "Derivative Works" shall mean any work, whether in Source or Object
65
+ form, that is based on (or derived from) the Work and for which the
66
+ editorial revisions, annotations, elaborations, or other modifications
67
+ represent, as a whole, an original work of authorship. For the purposes
68
+ of this License, Derivative Works shall not include works that remain
69
+ separable from, or merely link (or bind by name) to the interfaces of,
70
+ the Work and Derivative Works thereof.
71
+
72
+ "Contribution" shall mean any work of authorship, including
73
+ the original version of the Work and any modifications or additions
74
+ to that Work or Derivative Works thereof, that is intentionally
75
+ submitted to the Licensor for inclusion in the Work by the copyright owner
76
+ or by an individual or Legal Entity authorized to submit on behalf of
77
+ the copyright owner. For the purposes of this definition, "submitted"
78
+ means any form of electronic, verbal, or written communication sent
79
+ to the Licensor or its representatives, including but not limited to
80
+ communication on electronic mailing lists, source code control systems,
81
+ and issue tracking systems that are managed by, or on behalf of, the
82
+ Licensor for the purpose of discussing and improving the Work, but
83
+ excluding communication that is conspicuously marked or otherwise
84
+ designated in writing by the copyright owner as "Not a Contribution."
85
+
86
+ "Contributor" shall mean the Licensor and any individual or Legal Entity
87
+ on behalf of whom a Contribution has been received by the Licensor and
88
+ subsequently incorporated within the Work.
89
+
90
+ 2. Grant of Copyright License. Subject to the terms and conditions of
91
+ this License, each Contributor hereby grants to You a perpetual,
92
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
93
+ copyright license to reproduce, prepare Derivative Works of,
94
+ publicly display, publicly perform, sublicense, and distribute the
95
+ Work and such Derivative Works in Source or Object form.
96
+
97
+ 3. Grant of Patent License. Subject to the terms and conditions of
98
+ this License, each Contributor hereby grants to You a perpetual,
99
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
100
+ (except as stated in this section) patent license to make, have made,
101
+ use, offer to sell, sell, import, and otherwise transfer the Work,
102
+ where such license applies only to those patent claims licensable
103
+ by such Contributor that are necessarily infringed by their
104
+ Contribution(s) alone or by combination of their Contribution(s)
105
+ with the Work to which such Contribution(s) was submitted. If You
106
+ institute patent litigation against any entity (including a
107
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
108
+ or a Contribution incorporated within the Work constitutes direct,
109
+ contributory, or induced patent infringement, then any patent licenses
110
+ granted to You under this License for that Work shall terminate as
111
+ of the date such litigation is filed.
112
+
113
+ 4. Redistribution. You may reproduce and distribute copies of the
114
+ Work or Derivative Works thereof in any medium, with or without
115
+ modifications, and in Source or Object form, provided that You
116
+ meet the following conditions:
117
+
118
+ (a) You must give any other recipients of the Work or
119
+ Derivative Works a copy of this License; and
120
+
121
+ (b) You must cause any modified files to carry prominent notices
122
+ stating that You changed the files; and
123
+
124
+ (c) You must retain, in the Source form of any Derivative Works
125
+ that You distribute, all copyright, patent, trademark, and
126
+ attribution notices from the Source form of the Work,
127
+ excluding those notices that do not pertain to any part of
128
+ the Derivative Works; and
129
+
130
+ (d) If the Work includes a "NOTICE" text file as part of its
131
+ distribution, then any Derivative Works that You distribute must
132
+ include a readable copy of the attribution notices contained
133
+ within such NOTICE file, excluding notices that do not pertain to
134
+ any part of the Derivative Works, in at least one of the following
135
+ places: file in a notice that is provided along with the Derivative
136
+ Works; or, within a display generated by the Derivative Works, if
137
+ and wherever such third-party notices normally appear. The contents
138
+ of the NOTICE file do not constitute a contribution under the
139
+ meaning of this License. Any additional notices or messages that
140
+ You may include in a Derivative Work must be clearly marked as
141
+ not being part of the original NOTICE file.
142
+
143
+ This License does not grant permission to use the trade names,
144
+ trademarks, service marks, or product names of the Licensor, except
145
+ as required for reasonable and customary use in describing the
146
+ origin of the Work and reproducing the content of the NOTICE file.
147
+
148
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
149
+ any Contribution intentionally submitted for inclusion in the Work
150
+ by You to the Licensor shall be under the terms and conditions of
151
+ this License, without any additional terms or conditions.
152
+ Notwithstanding the above, nothing herein shall supersede or modify
153
+ the terms of any separate license agreement you may have executed
154
+ with the Licensor regarding such Contributions.
155
+
156
+ 6. Trademarks. This License does not grant permission to use the trade
157
+ names, trademarks, service marks, or product names of the Licensor,
158
+ except as required for reasonable and customary use in describing the
159
+ origin of the Work and reproducing the content of the NOTICE file.
160
+
161
+ 7. Disclaimer of Warranty. Unless required by applicable law or
162
+ agreed to in writing, Licensor provides the Work (and each
163
+ Contributor provides its Contributions) on an "AS IS" BASIS,
164
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
165
+ implied, including, without limitation, any warranties or conditions
166
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
167
+ PARTICULAR PURPOSE. You are solely responsible for determining the
168
+ appropriateness of using or redistributing the Work and assume any
169
+ risks associated with your exercise of permissions under this License.
170
+
171
+ 8. Limitation of Liability. In no event and under no legal theory,
172
+ whether in tort (including negligence), contract, or otherwise,
173
+ unless required by applicable law (such as deliberate and grossly
174
+ negligent acts) or agreed to in writing, shall any Contributor be
175
+ liable to You for damages, including any direct, indirect, special,
176
+ incidental, or consequential damages of any character arising as a
177
+ result of this License or out of the use or inability to use the
178
+ Work (including but not limited to damages for loss of goodwill,
179
+ work stoppage, computer failure or malfunction, or any and all
180
+ other commercial damages or losses), even if such Contributor
181
+ has been advised of the possibility of such damages.
182
+
183
+ 9. Accepting Warranty or Additional Liability. While redistributing
184
+ the Work or Derivative Works thereof, You may choose to offer,
185
+ and charge a fee for, acceptance of support, warranty, indemnity,
186
+ or other liability obligations and/or rights consistent with this
187
+ License. However, in accepting such obligations, You may act only
188
+ on your own behalf and on your own responsibility, not on behalf
189
+ of any other Contributor, and only if You agree to indemnify,
190
+ defend, and hold each Contributor harmless for any liability
191
+ incurred by, or claims asserted against, such Contributor by reason
192
+ of your accepting any such warranty or additional liability.
193
+
194
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1 @@
1
+ gossamer_browser