Skip to content

Commit 9a7a71d

Browse files
authored
Merge pull request #41 from browser-use/feat/phase-h-ts-harness
phase-h: TS harness port (v0.1.0 cut)
2 parents 92f3fd2 + 7e72a0c commit 9a7a71d

93 files changed

Lines changed: 52776 additions & 5257 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎UPSTREAM.md‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Upstream
22

3-
This doc tracks BrowserCode's relationship to its two upstream sources:
3+
This doc tracks BrowserCode's relationship to upstream:
44

55
1. **anomalyco/opencode** — forked in as the bulk of this repo. Sync runbook: `opencode-sync.md`.
6-
2. **browser-use/browser-harness** — vendored into `packages/bcode-browser/harness/`. Sync runbook: `harness-sync.md`.
76

8-
The two are deliberately independent — different upstreams, different cadences, different sync mechanisms (merge vs file-copy). One agent pulls one upstream at a time; never both in the same PR.
7+
(Phase H retired the `browser-use/browser-harness` vendoring relationship — see §3 below for the historical record. Browser code now lives in TS at `packages/bcode-browser/src/cdp/`, owned by us, no sync cadence.)
98

10-
Sections: **modification zones** (where is it safe to change upstream code?), **sync log** (when did we last pull each upstream and to what commit?), **harness divergences** (per-file deliberate-deltas list, used during harness sync).
9+
Sections: **modification zones** (where is it safe to change upstream code?), **sync log** (when did we last pull upstream and to what commit?), **harness retirement** (what happened to the vendored Python harness).
1110

1211
---
1312

@@ -54,7 +53,7 @@ Future Yellow modifications (per ROADMAP):
5453

5554
Every Yellow modification should be evaluated for conversion to a Green extension point via upstream PR. See decisions.md §1c and ROADMAP F8.
5655

57-
The harness has its own narrower zone policy (see §3 below): `agent-workspace/agent_helpers.py` is editable, the `src/browser_harness/` core package is protected, deliberate divergences are logged per-file.
56+
(The harness's narrower zone policy retired with Phase H — see §3.)
5857

5958
---
6059

@@ -98,9 +97,11 @@ Each upstream has its own append-only table. Add a row every time you pull.
9897

9998
---
10099

101-
## 3. Harness divergences and excluded paths
100+
## 3. Harness retirement (historical)
102101

103-
Per-file record of where `packages/bcode-browser/harness/` deliberately differs from upstream, plus the list of paths excluded from the vendored tree entirely. Read this *before* a sync diff so intentional differences aren't mistaken for missing features and excluded paths aren't accidentally re-imported.
102+
Phase H (TS port, v0.1.0) retired the `browser-use/browser-harness` vendoring. The Python harness was deleted; the CDP layer was ported to TS at `packages/bcode-browser/src/cdp/` (initial copy from `browser-use/browser-harness-js@95b7a22a`, ours after — see `packages/bcode-browser/src/cdp/PROVENANCE.md`). There is no sync cadence with either harness repo; behaviors of interest from either are tracked in `memory/browsercode/harness_watchlist.md` and ported individually as needed.
103+
104+
The historical sync log of the Python harness vendoring (Apr 26 – May 6, 2026) is preserved below for archaeology only; do not pull from those rows.
104105

105106
Path-allowlist policy (decisions.md §3.7, §4.5; updated for upstream PR #229 src-layout reorg):
106107

‎harness-sync.md‎

Lines changed: 0 additions & 148 deletions
This file was deleted.

‎packages/bcode-browser/README.md‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ Level-1 BrowserCode package: substantial, self-contained code with zero upstream
44

55
See `decisions.md §1c` (three-level model) and `§1d` (this package) in the BrowserCode project memory.
66

7-
## Contents (planned)
7+
## Contents
88

9-
| Path | Purpose | Roadmap phase |
10-
|---|---|---|
11-
| `harness/` | Vendored `browser-use/browser-harness` | A2 (vendored; tracking via `UPSTREAM.md`) |
12-
| `src/browser-execute/` | `browser_execute` tool body | A4 |
13-
| `src/fetch-use/` | `FetchUse.Service` implementation | B1 |
14-
| `src/cloud/` | Cloud deploy, skillbase, judge clients | D3–D4 |
9+
| Path | Purpose |
10+
|---|---|
11+
| `src/cdp/` | Vendored CDP layer (`session.ts`, `gen.ts`, `generated.ts`, protocol JSONs). Initial copy from `browser-use/browser-harness-js`; ours after — see `src/cdp/PROVENANCE.md`. |
12+
| `src/browser-execute.ts` | In-process JS-eval `browser_execute` body. |
13+
| `src/session-store.ts` | Per-opencode-session CDP `Session` map. The agent calls `session.connect(...)` from a snippet; subsequent snippets find the same Session. |
14+
| `src/skills.ts` | Runtime resolver for embedded skills (extract on first call in compiled mode; in-tree path in dev). |
15+
| `skills/` | `BROWSER.md` (the agent's prompt for `browser_execute`), `cloud-browser.md` (Way 3 — provision/stop a Browser Use cloud browser via raw HTTP from inside a snippet), and `interaction-skills/*.md` (UI mechanic reference docs). Embedded into the binary by `script/embed-skills.ts`. |
16+
| `script/embed-skills.ts` | Build-time embed; emits `bcode-skills.gen.ts` consumed by the compiled binary. |
17+
| `test/` | `bun test` smoke coverage for the workspace dynamic-import pattern. |
1518

16-
Integration into `packages/opencode` (tool registration, service wiring, CLI commands) is Level 2 and lives in `packages/opencode/src`. Per the one-line-hook rule, those hooks are pointers only — all logic lives here.
17-
18-
## Upstream tracking
19+
Planned (per ROADMAP phase): `src/fetch-use/` (B1), `src/cloud/` deploy/skillbase/judge clients (D3–D4).
1920

20-
Single source of truth: root-level `UPSTREAM.md`. Sync log across both upstreams (opencode + harness), modification zones, and per-file harness divergences. Sync runbook: `harness-sync.md` at repo root.
21+
Integration into `packages/opencode` (tool registration, service wiring, CLI commands) is Level 2 and lives in `packages/opencode/src`. Per the one-line-hook rule, those hooks are pointers only — all logic lives here.

‎packages/bcode-browser/harness/.github/ISSUE_TEMPLATE/bug-report.yml‎

Lines changed: 0 additions & 49 deletions
This file was deleted.

‎packages/bcode-browser/harness/.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎packages/bcode-browser/harness/.github/ISSUE_TEMPLATE/feature-request.yml‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎packages/bcode-browser/harness/.github/VOUCHED.td‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎packages/bcode-browser/harness/.gitignore‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

‎packages/bcode-browser/harness/AGENTS.md‎

Lines changed: 0 additions & 24 deletions
This file was deleted.

‎packages/bcode-browser/harness/LICENSE‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)