Skip to content

Commit 6119a41

Browse files
author
bcode
committed
remove cloud-browser.md, fold Way 3 into browser-execute-guide.md
Single skill file is sufficient: agent can derive stop/swap behavior from the inline Way 3 example plus the BU API docs link. Rewrites guide intro and Way sections for concision, adds runtime self-discovery hints (Object.keys(session.domains), CdpError.data) so the agent can probe the CDP surface without docs round-trip. Updates README, src/index.ts, src/skills.ts, opencode comment, and skills test to drop cloud-browser.md references.
1 parent 85fc1d3 commit 6119a41

7 files changed

Lines changed: 75 additions & 261 deletions

File tree

packages/bcode-browser/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ See `decisions.md §1c` (three-level model) and `§1d` (this package) in the Bro
1212
| `src/browser-execute.ts` | In-process JS-eval `browser_execute` body. |
1313
| `src/session-store.ts` | Per-opencode-session CDP `Session` map. The agent calls `session.connect(...)` from a snippet; subsequent snippets find the same Session. |
1414
| `src/skills.ts` | Runtime resolver for embedded skills (extract on first call in compiled mode; in-tree path in dev). |
15-
| `skills/` | `browser-execute-guide.md` (the agent's prompt for `browser_execute`) and `cloud-browser.md` (Way 3 — provision/stop a Browser Use cloud browser via raw HTTP from inside a snippet). Embedded into the binary by `script/embed-skills.ts`. The interaction-skills set inherited from the Python harness was archived 2026-05-09 — we'll reintroduce only what evals show is needed, one skill at a time. |
15+
| `skills/` | `browser-execute-guide.md` (the agent's prompt for `browser_execute`, covering all three connection Ways including Browser Use cloud provisioning via raw HTTP from inside a snippet). Embedded into the binary by `script/embed-skills.ts`. The interaction-skills set inherited from the Python harness was archived 2026-05-09 — we'll reintroduce only what evals show is needed, one skill at a time. |
1616
| `script/embed-skills.ts` | Build-time embed; emits `bcode-skills.gen.ts` consumed by the compiled binary. |
1717
| `test/` | `bun test` smoke coverage for the workspace dynamic-import pattern. |
1818

packages/bcode-browser/skills/browser-execute-guide.md

Lines changed: 63 additions & 94 deletions
Large diffs are not rendered by default.

packages/bcode-browser/skills/cloud-browser.md

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

packages/bcode-browser/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
// src/browser-execute.ts — in-process JS-eval browser_execute body
1212
// src/session-store.ts — per-opencode-session CDP Session map
1313
// src/skills.ts — runtime resolver for embedded skills
14-
// skills/ — browser-execute-guide.md + cloud-browser.md (embedded into binary)
14+
// skills/ — browser-execute-guide.md (embedded into binary)
1515
//
1616
// Cloud browser provisioning is intentionally NOT a separate Level-1
17-
// surface. The agent reads `skills/cloud-browser.md` and writes the
18-
// fetch+connect snippet itself, matching how local-browser connect works
19-
// (snippet-side, not tool-side). Decisions trail in
17+
// surface. The agent reads Way 3 of `skills/browser-execute-guide.md` and
18+
// writes the fetch+connect snippet itself, matching how local-browser
19+
// connect works (snippet-side, not tool-side). Decisions trail in
2020
// `memory/browsercode/decisions.md` §3.4.
2121
//
2222
// Planned (per ROADMAP phase):

packages/bcode-browser/src/skills.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Skills directory resolver.
22
//
33
// Materializes the skills tree to `<dataDir>/skills/` and substitutes the
4-
// `{{SKILLS_DIR}}` placeholder in every file with that absolute path so
5-
// cross-references inside browser-execute-guide.md (``read `{{SKILLS_DIR}}/cloud-browser.md` ``)
6-
// point at a real location.
4+
// `{{SKILLS_DIR}}` placeholder in every file with that absolute path so any
5+
// cross-references inside the skill files point at a real location.
76
//
87
// Compiled launches (the user-facing path) read a one-line sentinel at
98
// `<target>/.bcode-build` recording `<buildHash>:<target>`. When it matches

packages/bcode-browser/test/skills.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test("resolveSkillsDir materializes skills with {{SKILLS_DIR}} substituted", asy
1616
expect(dir).toBe(path.join(dataDir, "skills"))
1717
const browser = (await fs.readFile(path.join(dir, "browser-execute-guide.md"), "utf8")).replaceAll("\\", "/")
1818
expect(browser).not.toContain("{{SKILLS_DIR}}")
19-
expect(browser).toContain(`${dir.replaceAll("\\", "/")}/cloud-browser.md`)
19+
expect(browser).toContain(`${dir.replaceAll("\\", "/")}/`)
2020
} finally {
2121
await fs.rm(dataDir, { recursive: true, force: true })
2222
}

packages/opencode/src/tool/browser-execute.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export const BrowserExecuteTool = Tool.define(
2525
Effect.gen(function* () {
2626
const impl = yield* BrowserExecute.make(Global.Path.data)
2727
return {
28-
// Substitute the resolved skills path so browser-execute-guide.md / cloud-browser.md
29-
// references in the description point at concrete locations. Workspace
30-
// is per-project and agent-discoverable from cwd, so it's not
31-
// substituted here.
28+
// Substitute the resolved skills path so `{{SKILLS_DIR}}` references in
29+
// the description point at a concrete location. Workspace is
30+
// per-project and agent-discoverable from cwd, so it's not substituted
31+
// here.
3232
description: DESCRIPTION.replaceAll("{{SKILLS_DIR}}", impl.skillsDir),
3333
parameters: impl.parameters,
3434
execute: (args: Schema.Schema.Type<typeof impl.parameters>, ctx: Tool.Context) =>

0 commit comments

Comments
 (0)