Skip to content
Merged
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
6 changes: 3 additions & 3 deletions packages/bcode-browser/skills/browser-execute/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ Choose when the computer has no browser or to work in the background.

```js
// Provision and connect to a cloud browser
const r = await fetch("https://api.browser-use.com/api/v3/browsers", {
const r = await fetch("https://api.browser-use.com/api/v4/browsers", {
method: "POST",
headers: { "X-Browser-Use-API-Key": process.env.BROWSER_USE_API_KEY, "Content-Type": "application/json" },
body: "{}",
})
// Additional options: fetch https://docs.browser-use.com/cloud/api-v3/browsers/create-browser-session
// Additional options: fetch https://docs.browser-use.com/cloud/openapi/v4.json
const { id, cdpUrl, liveUrl } = await r.json()
const ver = await fetch(`${cdpUrl}/json/version`).then(r => r.json())
await session.connect({ wsUrl: ver.webSocketDebuggerUrl })
Expand All @@ -80,7 +80,7 @@ console.log("liveUrl for the user to watch:", liveUrl)

```js
// Browser Use cloud will eventually close idle browsers. An explicit stop frees the slot:
await fetch(`https://api.browser-use.com/api/v3/browsers/${id}`, {
await fetch(`https://api.browser-use.com/api/v4/browsers/${id}`, {
method: "PATCH",
headers: { "X-Browser-Use-API-Key": process.env.BROWSER_USE_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ action: "stop" }),
Expand Down
4 changes: 4 additions & 0 deletions packages/bcode-browser/test/skills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ test("resolveSkillsDir materializes skills with {{SKILLS_DIR}} substituted", asy
const browser = (await fs.readFile(path.join(dir, "browser-execute", "SKILL.md"), "utf8")).replaceAll("\\", "/")
expect(browser).not.toContain("{{SKILLS_DIR}}")
expect(browser).toContain(`${dir.replaceAll("\\", "/")}/`)
expect(browser).toContain('fetch("https://api.browser-use.com/api/v4/browsers"')
expect(browser).toContain("fetch(`https://api.browser-use.com/api/v4/browsers/${id}`")
expect(browser).toContain("https://docs.browser-use.com/cloud/openapi/v4.json")
expect(browser).not.toContain("https://api.browser-use.com/api/v3")
} finally {
await fs.rm(dataDir, { recursive: true, force: true })
}
Expand Down
Loading