From 7072fd010729673d0fa0e3fde571c1999ee4bd1a Mon Sep 17 00:00:00 2001 From: Gabby Morgan Date: Wed, 14 Oct 2026 18:05:56 +0000 Subject: [PATCH] Move python deps into the pack (requirements.txt) The pack owns its Playwright dep now, shipped at requirements.txt (standard pip format) instead of the agent repo's requirements/browser.txt. bootstrap installs packs//requirements.txt when the pack is selected; the browser binary is still downloaded by bootstrap. Update the client's install hint to the new path. --- bridge/browser_client.py | 3 ++- requirements.txt | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 requirements.txt diff --git a/bridge/browser_client.py b/bridge/browser_client.py index 3fa0c1c..b997282 100644 --- a/bridge/browser_client.py +++ b/bridge/browser_client.py @@ -41,7 +41,8 @@ DEFAULT_MAX_TEXT_CHARS = 20000 DEFAULT_MAX_MATCHES = 50 WAIT_UNTIL = ("commit", "domcontentloaded", "load", "networkidle") INSTALL_HINT = ( - "install the browser bridge stack: pip install -r requirements/browser.txt " + "install the browser bridge stack: pip install -r " + "packs/browser/requirements.txt " "&& PLAYWRIGHT_BROWSERS_PATH=/.runtime/browser python -m playwright " "install chromium" ) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c1eb9c7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,23 @@ +# Browser pack deps (optional). +# +# This file lives WITH the pack: a pack owns the python deps its skills/bridge +# need, and `scripts/bootstrap.sh` installs `packs//requirements.txt` for +# every pack the install plan selects (see PACKGEN.md, "Pack python deps"). The +# deps are lazy-imported by packs/browser/bridge/browser_client.py, so the core +# stays stdlib-only and every other bridge keeps running without them. Install +# with scripts/bootstrap.sh --browser, or by hand: +# .runtime/venv/bin/pip install -r packs/browser/requirements.txt +# PLAYWRIGHT_BROWSERS_PATH=.runtime/browser \ +# .runtime/venv/bin/python -m playwright install chromium +# +# The browser binaries are NOT shipped in the wheel: `playwright install` +# downloads Chromium into PLAYWRIGHT_BROWSERS_PATH. bootstrap.sh points that at +# the checkout's .runtime/browser (the containment rule); the bridge sets the +# same env var at launch, so the binaries live with the rest of the stack. Add +# `--with-deps` to the install command on a bare host to fetch the system +# libraries Chromium needs (needs sudo). +# +# Only `chromium` is installed by default; switch bridges.browser.engine to +# firefox/webkit and run `python -m playwright install firefox`/`webkit` for +# those. +playwright==1.63.0