Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/stagehand-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand All @@ -41,7 +41,7 @@ jobs:
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/stagehand-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand All @@ -57,7 +57,7 @@ jobs:
- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/stagehand-python'
id: github-oidc
uses: actions/github-script@v6
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

Expand All @@ -75,7 +75,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/stagehand-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand Down
119 changes: 79 additions & 40 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ name: Publish PyPI

on:
workflow_dispatch:
inputs:
stagehand_tag:
description: "Stagehand repo git ref to build SEA binaries from (e.g. @browserbasehq/stagehand@3.0.6)"
required: true
type: string
inputs: {}

release:
types: [published]
Expand Down Expand Up @@ -42,46 +38,45 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.9.13"

- name: Checkout stagehand (server source)
uses: actions/checkout@v4
with:
repository: browserbase/stagehand
ref: ${{ inputs.stagehand_tag || vars.STAGEHAND_TAG }}
path: _stagehand
fetch-depth: 1
# If browserbase/stagehand is private, set STAGEHAND_SOURCE_TOKEN (PAT) in this repo.
token: ${{ secrets.STAGEHAND_SOURCE_TOKEN || github.token }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Resolve latest stagehand/server release
id: stagehand-server-release
uses: actions/github-script@v6
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "23"
cache: "pnpm"
cache-dependency-path: _stagehand/pnpm-lock.yaml

- name: Build SEA server binary (from source)
github-token: ${{ secrets.STAGEHAND_SOURCE_TOKEN || github.token }}
script: |
const { data } = await github.rest.repos.listReleases({
owner: 'browserbase',
repo: 'stagehand',
per_page: 100,
});
const release = data.find(r => typeof r.tag_name === 'string' && r.tag_name.startsWith('stagehand-server/v'));
if (!release) {
core.setFailed('No stagehand-server/v* release found in browserbase/stagehand');
return;
}
core.info(`Using stagehand/server release tag: ${release.tag_name}`);
core.setOutput('tag', release.tag_name);
core.setOutput('id', String(release.id));

- name: Download stagehand/server SEA binary (from GitHub Release assets)
env:
GH_TOKEN: ${{ secrets.STAGEHAND_SOURCE_TOKEN || github.token }}
RELEASE_TAG: ${{ steps.stagehand-server-release.outputs.tag }}
RELEASE_ID: ${{ steps.stagehand-server-release.outputs.id }}
ASSET_NAME: ${{ matrix.binary_name }}
OUTPUT_PATH: ${{ matrix.output_path }}
shell: bash
run: |
set -euo pipefail

if [[ -z "${{ inputs.stagehand_tag }}" && -z "${{ vars.STAGEHAND_TAG }}" ]]; then
echo "Missing stagehand ref: set repo variable STAGEHAND_TAG or provide workflow input stagehand_tag." >&2
exit 1
fi

# Ensure we only ship the binary built for this runner's OS/arch.
# Ensure we only ship the binary for this runner's OS/arch.
python - <<'PY'
from pathlib import Path
sea_dir = Path("src/stagehand/_sea")
Expand All @@ -92,19 +87,63 @@ jobs:
p.unlink(missing_ok=True)
PY

pushd _stagehand >/dev/null
pnpm install --frozen-lockfile
CI=true pnpm --filter @browserbasehq/stagehand-server build:binary
popd >/dev/null
echo "Downloading ${ASSET_NAME} from browserbase/stagehand@${RELEASE_TAG}"

cp "_stagehand/packages/server/dist/sea/${{ matrix.binary_name }}" "${{ matrix.output_path }}"
chmod +x "${{ matrix.output_path }}" 2>/dev/null || true
url="$(
curl -fsSL \
-H "Authorization: Bearer ${GH_TOKEN}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/browserbase/stagehand/releases/${RELEASE_ID}" \
| python -c 'import json,sys; d=json.load(sys.stdin); a=next((x for x in d.get("assets",[]) if x.get("name")==sys.argv[1]), None); print(a.get("url","") if a else "")' \
"${ASSET_NAME}"
)"

if [ -z "${url}" ]; then
echo "Release asset not found: ${ASSET_NAME} (tag=${RELEASE_TAG})" >&2
exit 1
fi

mkdir -p "$(dirname "${OUTPUT_PATH}")"
curl -fsSL \
-H "Authorization: Bearer ${GH_TOKEN}" \
-H "Accept: application/octet-stream" \
"${url}" \
-o "${OUTPUT_PATH}"

chmod +x "${OUTPUT_PATH}" 2>/dev/null || true
rm -f src/stagehand/_sea/.keep || true

- name: Build wheel
env:
STAGEHAND_WHEEL_TAG: py3-none-${{ matrix.wheel_platform_tag }}
run: uv build --wheel

- name: Log SEA contents
shell: bash
run: |
echo "Contents of src/stagehand/_sea/"
ls -al src/stagehand/_sea || true
python - <<'PY'
import pathlib, zipfile, collections, sys
had_error = False
for wheel in sorted(pathlib.Path("dist").glob("*.whl")):
print(f"Contents of {wheel.name} entries matching stagehand/_sea")
with zipfile.ZipFile(wheel, "r") as zf:
names = [info.filename for info in zf.infolist()]
counts = collections.Counter(names)
dups = sorted([name for name, n in counts.items() if n > 1])
for info in zf.infolist():
if "stagehand/_sea/" in info.filename:
print(info.filename)
if dups:
had_error = True
print("ERROR: duplicate zip entries detected:")
for name in dups:
print(f" {counts[name]}x {name}")
if had_error:
sys.exit(1)
PY

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'browserbase/stagehand-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Check release environment
run: |
Expand Down
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.3.1"
}
".": "3.5.1"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-419940ce988c43313660d30a5bb5b5c2d89b3b19a0f80fe050331e0f4e8c58d2.yml
openapi_spec_hash: a621ca69697ebba7286cbf9e475c46ad
config_hash: 1f709f8775e13029dc60064ef3a94355
configured_endpoints: 8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-43e6dd4ce19381de488d296e9036fea15bfea9a6f946cf8ccf4e02aecc8fb765.yml
openapi_spec_hash: f736e7a8acea0d73e1031c86ea803246
config_hash: b375728ccf7d33287335852f4f59c293
100 changes: 100 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,105 @@
# Changelog

## 3.5.1 (2026-01-29)

Full Changelog: [v3.5.0...v3.5.1](https://github.com/browserbase/stagehand-python/compare/v3.5.0...v3.5.1)

### Chores

* sync repo ([033e0ba](https://github.com/browserbase/stagehand-python/commit/033e0ba529ae29b0732627291a09074306d7abb0))

## 3.5.0 (2026-01-29)

Full Changelog: [v3.4.8...v3.5.0](https://github.com/browserbase/stagehand-python/compare/v3.4.8...v3.5.0)

### Features

* add auto-bedrock support based on bedrock/provider.model-name ([eaded9f](https://github.com/browserbase/stagehand-python/commit/eaded9ffb050c297b86223c333044d8c22dd3cf4))
* Update stainless.yml for project and publish settings ([f90c553](https://github.com/browserbase/stagehand-python/commit/f90c55378c03c18215d1cdc153f84d587e5048b0))


### Bug Fixes

* **docs:** fix mcp installation instructions for remote servers ([85f8584](https://github.com/browserbase/stagehand-python/commit/85f85840c9e9de4c0c1b07ec1ef41936788ea88b))


### Chores

* **internal:** version bump ([d227b02](https://github.com/browserbase/stagehand-python/commit/d227b0213aa729243fbc56d818a808536b98b191))
* update SDK settings ([879b799](https://github.com/browserbase/stagehand-python/commit/879b7990e8095ca106bf9553159d6c7a01936ec9))

## 3.4.8 (2026-01-27)

Full Changelog: [v3.4.7...v3.4.8](https://github.com/browserbase/stagehand-python/compare/v3.4.7...v3.4.8)

### Chores

* sync repo ([efaf774](https://github.com/browserbase/stagehand-python/commit/efaf774f0dbd93db8e15e5c3800d62dd7670006c))

## 3.4.7 (2026-01-15)

Full Changelog: [v3.4.6...v3.4.7](https://github.com/browserbase/stagehand-python/compare/v3.4.6...v3.4.7)

## 3.4.6 (2026-01-13)

Full Changelog: [v3.4.5...v3.4.6](https://github.com/browserbase/stagehand-python/compare/v3.4.5...v3.4.6)

### Chores

* remove duplicate .keep files for pypi publish step fix ([5235658](https://github.com/browserbase/stagehand-python/commit/5235658b9360362d70d9154a96b53fe69167101d))

## 3.4.5 (2026-01-13)

Full Changelog: [v3.4.4...v3.4.5](https://github.com/browserbase/stagehand-python/compare/v3.4.4...v3.4.5)

### Chores

* windows logging/build fix ([5ed0e5f](https://github.com/browserbase/stagehand-python/commit/5ed0e5f633082295b1ab17af9291d6efc863d25d))

## 3.4.4 (2026-01-13)

Full Changelog: [v3.4.3...v3.4.4](https://github.com/browserbase/stagehand-python/compare/v3.4.3...v3.4.4)

### Chores

* publish-pypi lint fix ([71abdc6](https://github.com/browserbase/stagehand-python/commit/71abdc6f805c95f42da7c74dde961209a58290e7))

## 3.4.3 (2026-01-13)

Full Changelog: [v3.4.2...v3.4.3](https://github.com/browserbase/stagehand-python/compare/v3.4.2...v3.4.3)

### Chores

* force-include SEA binaries in wheel ([301147c](https://github.com/browserbase/stagehand-python/commit/301147ce8f7fde3726e04efaaecfcdc5755b7683))

## 3.4.2 (2026-01-13)

Full Changelog: [v3.4.1...v3.4.2](https://github.com/browserbase/stagehand-python/compare/v3.4.1...v3.4.2)

### Chores

* sync repo ([2d4bd0a](https://github.com/browserbase/stagehand-python/commit/2d4bd0aee5a1f03ed09473a43f5607871f05c7ee))

## [3.4.1](https://github.com/browserbase/stagehand-python/compare/v0.4.0...v3.4.1) (2026-01-13)


### Documentation

* refresh README for release ([41926c7](https://github.com/browserbase/stagehand-python/commit/41926c77f9f8ffcca32c341a33d50dc731e1d84a))

## [0.4.0](https://github.com/browserbase/stagehand-python/compare/v0.3.1...v0.4.0) (2026-01-13)


### Features

* don't close new opened tabs ([#161](https://github.com/browserbase/stagehand-python/issues/161)) ([#169](https://github.com/browserbase/stagehand-python/issues/169)) ([f68e86c](https://github.com/browserbase/stagehand-python/commit/f68e86c90d9e5f30d2f447ada65cc711ac531baa))


### Bug Fixes

* active page context ([#251](https://github.com/browserbase/stagehand-python/issues/251)) ([d61e118](https://github.com/browserbase/stagehand-python/commit/d61e118ccc8845ac95e4579f6137a91abb004943))
* set injected Stagehand cursor position to fixed for correct viewport tracking ([#121](https://github.com/browserbase/stagehand-python/issues/121)) ([#122](https://github.com/browserbase/stagehand-python/issues/122)) ([93c16e3](https://github.com/browserbase/stagehand-python/commit/93c16e392d754227f9bec47ee9d9f26046bfb770))

## 0.3.1 (2026-01-13)

Full Changelog: [v0.3.0...v0.3.1](https://github.com/browserbase/stagehand-python/compare/v0.3.0...v0.3.1)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ If you’d like to use the repository from source, you can either install from g
To install via git:

```sh
uv run pip install git+ssh://git@github.com/browserbase/stagehand-python#stainless.git
$ uv run pip install git+ssh://git@github.com/browserbase/stagehand-python.git
```

Alternatively, you can build from source and install the wheel file:
Expand Down
Loading