mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
The plugin exposed only tools; the BrowserSkill agent skill never reached the harness's <available_skills> catalog. Register it as an embedded runtime skill (progressive disclosure: catalog entry resident, body on skill-tool invocation) via the official ctx.skills seam — silent no-op when the composition lacks it. Content is build-time assembled so there is one source of truth: skill/prelude.md (committed, dsh-specific: tool<->CLI map, owned-session semantics, plugin-only overrides) + the canonical repo-root skill/SKILL.md verbatim (the same file crates/bsk-cli/build.rs mirrors; frontmatter stripped, name/description supplied by the registration). Generated into src/skill-content.generated.ts (gitignored) — registration and every pre-step snapshot are pure in-memory reads: no disk, no process, no daemon. Scripts: build:skill chained into build/test/typecheck (same pattern as build:css); biome excludes the generated artifacts. Tests: +3 (catalog content, in-memory weight, silent degradation). 116/116 green.
51 lines
2.5 KiB
Markdown
51 lines
2.5 KiB
Markdown
# browser-skill (dsh edition)
|
|
|
|
Drive the user's **real Chromium browser** (logins, cookies, Agent Window isolation)
|
|
through this plugin's `browser_*` tools. Each tool spawns `bsk <cmd> --json` — the
|
|
same engine the canonical CLI skill documents — so the workflow, judgment rules, and
|
|
safety constraints are identical.
|
|
|
|
## Tool ↔ CLI map
|
|
|
|
The tools below are thin, structured wrappers over the bsk CLI verbs of the same
|
|
name; `session` parameters take the 4-letter session id (no `--session` flag
|
|
spelling here):
|
|
|
|
| dsh tool | bsk equivalent |
|
|
|---|---|
|
|
| `browser_session_start` / `browser_session_stop` / `browser_session_list` | `bsk session start/stop/list` |
|
|
| `browser_navigate` | `bsk navigate` |
|
|
| `browser_snapshot` / `browser_observe` | `bsk snapshot` / `bsk observe` |
|
|
| `browser_click` / `browser_fill` / `browser_press` | `bsk click` / `bsk fill` / `bsk press` |
|
|
| `browser_screenshot` | `bsk screenshot` |
|
|
| `browser_emulate` | `bsk emulate` |
|
|
|
|
(`bsk console` / `bsk network` have no tool counterpart in this plugin yet.)
|
|
|
|
Plugin-specific semantics that override or narrow the CLI rules below:
|
|
|
|
- **Owned sessions only**: this plugin sees and acts on just the sessions IT
|
|
started via `browser_session_start`. `browser_session_list` shows only those
|
|
(with the current marker); passing a session id created by another program
|
|
(or person) sharing the bsk daemon is refused outright — never retry those
|
|
with the same id.
|
|
- **Current session**: omitted `session` parameters resolve to the most
|
|
recently started or used OWNED session. With several sessions in flight,
|
|
pass `session` explicitly to avoid surprises.
|
|
- **Screenshots**: when the model route accepts images, `browser_screenshot`
|
|
returns the PNG inline as an image attachment; otherwise it returns the
|
|
saved file path.
|
|
- **`browser_emulate mobile`**: requires `width`+`height` — the bsk daemon
|
|
refuses `--mobile` without viewport dimensions.
|
|
- **Live observation**: in the dsh Web UI, every owned session is watched by
|
|
the floating overlay (thumbnails, action, interrupt) — observational side
|
|
traffic is free and never steals your command turn; just keep acting.
|
|
|
|
The canonical CLI skill body follows verbatim (source of truth: `skill/SKILL.md`
|
|
in the BrowserSkill repo, mirrored by build into `crates/bsk-cli/skill/SKILL.md`).
|
|
Read `bsk <verb> --session <id>` as "the `browser_<verb>` tool with
|
|
`session: <id>`"; everything else — when to use, the stop-when-done rules, the
|
|
interaction loop, refs, sandbox rules — applies unchanged.
|
|
|
|
---
|