文档
Task spaces
How Browseokay keeps an agent's pages separate from yours.
A task space is where the agent does one job. It holds the agent's pages and keeps them apart from the tabs you opened yourself.
The rules the skill gives the agent
- Use one task space per goal. Create it once, print its id, and resume the same space in later rounds.
- A new space starts with page
p1. Navigate it rather than opening a new page for every URL. - Pages get permanent labels (
p1,p2,p3…). Variables don't survive between runs; spaces, tabs and labels do. - Tabs the agent didn't open are treated as yours. The agent doesn't close them, and finishing a task doesn't close a space that still has your tabs in it.
A minimal script
const task = await taskSpace("check notifications");
const page = task.page("p1");
await page.goto("https://github.com/notifications");
console.log({ space: task.spaceId, page: page.label });
console.log(await page.snapshot());
In a later round the agent resumes with await taskSpace(<id>).
Handing control to you
When a human is needed — a login, a captcha, a permission prompt — the agent calls task.handOff(), stops, and tells you what to do. After you confirm, it takes the space back and continues.
Finishing
When the job is done the agent calls task.finish({ keep: [] }), which closes its own pages. It keeps a page open only when you asked to see the result there.