@caiqy/browser-skill-dsh-plugin 0.3.3-dsh.2 → 0.3.3-dsh.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,301 +1,301 @@
1
- # BrowserSkill for DeepSeek Harness
2
-
3
- [![npm version](https://img.shields.io/npm/v/@caiqy/browser-skill-dsh-plugin)](https://www.npmjs.com/package/@caiqy/browser-skill-dsh-plugin)
4
-
5
- Use [BrowserSkill](https://github.com/Tencent/BrowserSkill) in
6
- [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`) to browse
7
- websites, fill forms, and capture screenshots through native `bsk_*` tools.
8
- Browser tasks run in Agent Windows, with a live view in the dsh Web UI.
9
-
10
- This fork publishes `0.3.3-dsh.2` as `@caiqy/browser-skill-dsh-plugin`, carrying
11
- the local enhancements over official `0.3.3`. The official package remains
12
- `@wxg-prc-cpg/browser-skill-dsh-plugin`. Install only one of the two packages in a
13
- profile: they register the same `bsk_*` tools and observation routes.
14
- See [DSH enhancement delivery notes](https://github.com/caiqy/BrowserSkill/blob/dsh/plugin-parity-0.3.3/packages/dsh-plugin-browserskill/docs/dsh-enhancement.md)
15
- for the baseline, structured examples and actual verification boundaries.
16
-
17
- ## Installation
18
-
19
- Before installing the plugin:
20
-
21
- - Install [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) and
22
- [pnpm](https://pnpm.io/installation), which dsh uses to manage plugins.
23
- - Install the `bsk` CLI and connect the BrowserSkill extension in Chrome or Edge.
24
- Follow the [BrowserSkill setup guide](https://github.com/Tencent/BrowserSkill#quick-start).
25
- - Make sure `bsk` is on the `PATH` used to start dsh, or set `bskPath` in the plugin configuration.
26
-
27
- Install the plugin into the `web` profile, then start it:
28
-
29
- ```sh
30
- dsh plugin --profile web add @caiqy/browser-skill-dsh-plugin@0.3.3-dsh.2
31
- dsh --profile web
32
- ```
33
-
34
- Replace `web` with your profile name if you use a different profile. The plugin
35
- includes the complete `browser-skill` package; no separate `bsk install-skill` step is needed.
36
- Its compact entry point loads first; references ship with the plugin and are read only
37
- when needed. Relative paths resolve from the packaged skill directory, not your project.
38
-
39
- In a conversation, try:
40
-
41
- ```text
42
- /browser-skill open example.com and summarize the page.
43
- ```
44
-
45
- By default, the browser tools become available when the skill is invoked.
46
-
47
- The plugin declares support for DSH `^0.1.5-rc.3 || ^0.2.0-rc.1`.
48
- DSH 0.2 checks these peer requirements before loading the plugin; versions outside
49
- this range are not declared compatible. The range preserves the existing 0.1.x
50
- baseline and admits 0.2.x without opting into future 0.3.x hosts.
51
-
52
- ## Updating
53
-
54
- Installed plugins do not update automatically. Install this exact fork release:
55
-
56
- ```sh
57
- dsh plugin --profile web add @caiqy/browser-skill-dsh-plugin@0.3.3-dsh.2
58
- ```
59
-
60
- To follow the fork's current release, install `@caiqy/browser-skill-dsh-plugin@dsh`.
61
- The fork publishes prereleases under the npm `dsh` dist-tag.
62
- See the [manual update/rollback procedure](https://github.com/caiqy/BrowserSkill/blob/dsh/plugin-parity-0.3.3/packages/dsh-plugin-browserskill/docs/dsh-enhancement.md#更新与回退).
63
- Restart that dsh profile after upgrading. This command updates the plugin; update
64
- the `bsk` CLI and browser extension separately when a release requires it.
65
-
66
- ### Breaking tool API migration (0.3.3)
67
-
68
- The coordinated 0.3.3 release replaces all six `browser_*` tool names with stable
69
- BrowserSkill-specific names. This avoids collisions with other browser plugins
70
- such as `dsh-builtin-browser`; both plugins keep their own tools and sessions.
71
-
72
- | Previous name | New name |
73
- | --- | --- |
74
- | `browser_session` | `bsk_session` |
75
- | `browser_page` | `bsk_page` |
76
- | `browser_inspect` | `bsk_inspect` |
77
- | `browser_interact` | `bsk_interact` |
78
- | `browser_tabs` | `bsk_tabs` |
79
- | `browser_assist` | `bsk_assist` |
80
-
81
- The tool-name migration leaves actions, parameters, results and `/browser-skill`
82
- unchanged. The old tool
83
- names are not registered as aliases. After upgrading, restart the DSH profile and
84
- invoke `/browser-skill` again in existing conversations to load the new instructions.
85
- Update hardcoded tool calls, allow/deny lists, and `toolOrder` entries to the new
86
- names. Do not replay old calls unchanged: another plugin may own those names.
87
-
88
- Existing conversation logs and screenshot attachments are left intact. New
89
- `bsk_inspect` results use the screenshot view; old `browser_inspect` cards may use
90
- DSH's generic renderer and do not retain the custom thumbnail/preview interaction.
91
- This is a breaking change from 0.3.2. Upgrade the CLI and browser extension to
92
- 0.3.3 before upgrading this plugin to use the new video, extraction and element-wait
93
- capabilities. Updating the npm package does not update either component.
94
-
95
- ## Tools
96
-
97
- | Tool | Actions | Purpose |
98
- | --- | --- | --- |
99
- | `bsk_session` | `start`, `stop`, `list`, `browsers` | Manage plugin-owned sessions; query connected browser instances. |
100
- | `bsk_page` | `navigate`, `back`, `forward`, `reload`, `wait`, `wait-for-element`, `wait-ms` | Navigate; wait for lifecycle events, an element condition, or a fixed delay. |
101
- | `bsk_inspect` | `observe`, `snapshot`, `html`, `screenshot`, `console`, `network`, `debug`, `video`, `extract` | Inspect page state, debug websites, capture screenshots or requested task videos, and export structured tables/lists. |
102
- | `bsk_interact` | `click`, `hover`, `wheel`, `scroll-to`, `focus`, `blur`, `fill`, `select`, `press`, `evaluate`, `upload`, `download` | Interact with controls, evaluate page scripts and transfer local files. |
103
- | `bsk_tabs` | `list`, `create`, `select`, `close`, `borrow`, `return` | Manage Agent Window tabs and temporarily borrow user tabs. |
104
- | `bsk_assist` | `resize`, `emulate`, `request-help` | Resize or emulate the browser and pause for human-only steps. |
105
-
106
- For `bsk_page` with `action: "wait-for-element"`, see the
107
- [element-wait reference](skill/references/interaction-details.md#element-waits) for
108
- supported conditions, timeout results and recovery with existing single actions.
109
-
110
- For native wheel input (`action: "wheel"`), see the [wheel reference](../../docs/wheel.md)
111
- for signed deltas, optional targets, result semantics and interruption.
112
-
113
- For `bsk_interact` with `action: "scroll-to"`, see the
114
- [scroll-to reference](../../docs/scroll-to.md) for parameters, visible bounds and errors.
115
-
116
- For `bsk_inspect` with `action: "extract"`, see
117
- [structured extraction](../../docs/structured-extraction.md) for discovery, list
118
- fields, JSON/CSV output and loaded-DOM completeness.
119
-
120
- Page-script evaluation is available through `bsk_interact` with `action: "evaluate"`.
121
- The local enhancement also adds full-page screenshots, HTML file export, hover
122
- probes, extended emulation and named sessions; see the [structured examples](docs/dsh-enhancement.md#结构化工具示例).
123
- User interaction trace recording remains unsupported; existing task video is separate.
124
-
125
- ### Activation failures
126
-
127
- The six tools register as a complete suite. If any registration fails, the plugin
128
- rolls back that attempt and reports the failing tool through DSH's logger. A model
129
- invocation of `skill` returns an error instead of claiming successful activation;
130
- slash-command and restored conversations receive a scoped notice. Unrelated
131
- conversations continue normally, and repeated identical failures do not flood logs.
132
-
133
- Resolve the reported registration error, then invoke `/browser-skill` again or
134
- start the next turn to retry. Session entry and service discovery also retry a
135
- pending activation; streaming events do not. The affected conversation receives
136
- one recovery notice. If the failed model call never delivered the skill body,
137
- the notice asks the model to load it before using the tools. With `lazyTools: false`,
138
- a registration failure fails plugin startup and releases its resources; reload
139
- after fixing it.
140
-
141
- ## Multi-session model
142
-
143
- One agent conversation can drive several browser sessions at once:
144
-
145
- - `bsk_session` with `action: start` returns the session id and makes it the **current session**.
146
- - Every operation tool accepts an optional `session` argument. When omitted, the call acts on the
147
- current session (the one most recently started or used); when given, that session becomes current.
148
- - Every tool result echoes the session it actually acted on, so the model never has to guess.
149
- - The number of concurrent sessions started through the plugin is capped (`maxSessions`, default 5).
150
- - Unloading the plugin stops every session it started and kills in-flight bsk processes.
151
-
152
- Starts are journaled before creating a window. Lost replies and failed cleanup remain
153
- recoverable on reload; `bsk_session action=list` reports `pendingCleanup`, and stop
154
- can retry it even when there is no current session. This requires a CLI and daemon
155
- that support recoverable starts. See [the lifecycle contract](../../docs/recoverable-session-starts.md).
156
-
157
- Stops also retain their target and cleanup intent. A failed or interrupted stop can be
158
- retried without accidentally stopping the next current session. Once the intent is saved,
159
- cancelling the call only stops waiting; cleanup continues in the background. If it finishes
160
- before a retry, that retry acknowledges the original result. With several unacknowledged
161
- stops, pass `session` or the owned `requestId` explicitly (not both). List exposes request
162
- IDs; stop results include `requestId` and `alreadyClosed`. Completed receipts survive reload
163
- until acknowledged and do not occupy browser capacity.
164
-
165
- **Ownership boundary**: the bsk daemon may be shared with other agents, terminals, or dsh
166
- instances. The plugin therefore only ever sees and operates on sessions it created itself —
167
- an explicit `session` argument naming a foreign or unknown id is rejected, the `list` action on
168
- `bsk_session` shows plugin-created sessions only (no daemon-wide view), and stop/unload cleanup
169
- can never touch a session owned by another program.
170
-
171
- ## Configuration
172
-
173
- After installing the plugin, edit your profile's `cordis.patch.yml`. For the `web`
174
- profile, the default location is `~/.dsh/profiles/web/cordis.patch.yml`. If you set
175
- `DSH_HOME`, use `$DSH_HOME/profiles/web/cordis.patch.yml` instead. Replace `web` with
176
- your profile name as needed.
177
-
178
- If the file contains only comments and `[]`, keep the comments and replace `[]`
179
- with the YAML below. If it already contains patch entries, add this entry to the
180
- existing list or edit its existing `id: browserskill` entry. Keep a single
181
- top-level YAML list. This overrides the plugin registered by the installed bundle:
182
-
183
- ```yaml
184
- - id: browserskill
185
- config:
186
- bskPath: bsk
187
- defaultTimeoutMs: 120000
188
- maxSessions: 5
189
- observationEnabled: true
190
- thumbnailIntervalMs: 1500
191
- idleIntervalMs: 8000
192
- lazyTools: true
193
- ```
194
-
195
- Change `bskPath` to the full path of your CLI binary if it is not on dsh's `PATH`.
196
- A patch replaces the entry's entire `config` object, so keep all overrides you need
197
- together in that object.
198
-
199
- Configuration changes follow `dsh.profile.patchReload` in the profile's
200
- `package.json`: `live` (the default for `web`) applies changes when you save the
201
- patch file; `startup` requires restarting the profile. Restart after upgrading
202
- the plugin in either case.
203
-
204
- All fields are optional; omitted fields use the defaults below:
205
-
206
- | Option | Default | Purpose |
207
- | --- | --- | --- |
208
- | `bskPath` | `bsk` | Path to the CLI binary. |
209
- | `sessionStateDirectory` | Scoped under `$BSK_HOME/dsh-starts` (or `~/.bsk/dsh-starts`) | Durable recovery records; optionally isolate by host/profile. |
210
- | `defaultTimeoutMs` | `120000` | Default command execution timeout in milliseconds; output collection after exit has a separate 2-second limit. |
211
- | `maxSessions` | `5` | Maximum concurrent sessions started by this plugin. |
212
- | `observationEnabled` | `true` | Enable live browser observation. |
213
- | `thumbnailIntervalMs` | `1500` | Screenshot interval for active sessions, in milliseconds. |
214
- | `idleIntervalMs` | `8000` | Screenshot interval for idle sessions and the recent-activity window, in milliseconds. |
215
- | `lazyTools` | `true` | Reveal the browser tools when the skill is invoked. Set `false` to register them at startup. |
216
-
217
- With `lazyTools: true`, only the skill's catalog entry is initially advertised to
218
- the model. A successful model `skill` call makes the six `bsk_*` schemas available
219
- in the next step. A user `/browser-skill` gesture activates them when the host
220
- claims the input, before prompt assembly, so the first request includes both the
221
- skill instructions and tool schemas. Set `lazyTools: false` to register at startup.
222
-
223
- After a plugin reload, a live or resumed conversation's successful skill invocation
224
- restores the tools from its stored history. If an older plugin reports
225
- `unknown tool "bsk_session"`, invoke `skill browser-skill` again, or set
226
- `lazyTools: false` in the profile patch as a temporary workaround.
227
-
228
- ## Live browser view
229
-
230
- The dsh Web UI prefers a **Browser Skill** tab in DSH's native right sidebar.
231
- The native tab opens when the current conversation first has a browser session;
232
- ordinary screenshot and action updates do not switch tabs or reopen a tab you
233
- closed. You can reopen it from the sidebar's guide.
234
-
235
- The native sidebar is optional. Profiles without its services use a floating
236
- panel, and a failed native integration falls back to that panel. No
237
- `dsh-better-sidebar` installation is required; it can coexist with BrowserSkill,
238
- which registers directly with DSH rather than with the third-party sidebar.
239
-
240
- - See the current action, elapsed time, and recent screenshot for each session.
241
- - Select a session to focus on it. The sidebar view follows the current conversation.
242
- - Use **Use floating view** to move observation into a floating panel, and
243
- **Move to sidebar** (or **Show here** in the tab) to return. This choice lasts
244
- only until the page reloads; it is not saved in your profile or browser storage.
245
- - Use **Interrupt** to cancel the current browser command. The agent may continue
246
- with another action afterward.
247
- - Drag or resize the floating panel, or use **Pop out** to open a Picture-in-Picture
248
- window in browsers that support it.
249
- - Periodic screenshots are requested while a browser observation view is visible.
250
- Configure the active and idle intervals with the options above.
251
-
252
- The floating panel shows all browser sessions managed by this plugin instance;
253
- the native tab shows the current conversation's browsers and those of its subagents.
254
-
255
- The observation endpoints require a loopback address such as `localhost` or
256
- `127.0.0.1`. Access through a LAN hostname or non-loopback reverse proxy is not supported.
257
-
258
- ## Development
259
-
260
- ```sh
261
- pnpm install
262
- pnpm --filter @caiqy/browser-skill-dsh-plugin typecheck
263
- pnpm --filter @caiqy/browser-skill-dsh-plugin test # unit tests mock bsk; no browser needed
264
- pnpm --filter @caiqy/browser-skill-dsh-plugin build # tsdown -> lib/
265
- ```
266
-
267
- See the [development notes](https://github.com/Tencent/BrowserSkill/blob/main/packages/dsh-plugin-browserskill/docs/development.md)
268
- for skill registration, tool results, and observation APIs in the current source.
269
-
270
- ## Publishing
271
-
272
- This fork is published manually from the independent BrowserSkill workspace.
273
- Run the package's typecheck, build and tests, then `node scripts/check-dsh-package.mjs`.
274
- Pack the built package with `npm pack --ignore-scripts` and publish the inspected
275
- archive with `npm publish <archive.tgz> --access public --tag dsh --registry=https://registry.npmjs.org/`.
276
-
277
- Publish only `@caiqy/browser-skill-dsh-plugin`; the official
278
- `@wxg-prc-cpg/browser-skill-dsh-plugin` package is maintained upstream.
279
- Use the `caiqy-dsh-plugin-v<version>` tag for fork releases, which does not trigger
280
- the inherited upstream release workflow. Push the fork commit before updating the
281
- parent workspace's submodule pointer and market index.
282
-
283
- Keep the official 0.3.3 CLI and extension installed separately. Publishing this
284
- plugin does not update those components. Published npm versions cannot be overwritten.
285
-
286
- ## License
287
-
288
- MIT
289
-
290
- ## Task video recording
291
-
292
- Ask the agent to record before it performs the task. It starts an authorized task
293
- tab, confirms recording is active, performs the task, then stops video before
294
- ending the session. No manual Start click is required. Preview and Save As are in
295
- the extension's Features → Video recording → Recent recordings.
296
-
297
- `bsk_inspect` with `action: "video"` exposes `videoAction` start/status/stop/save/
298
- list/discard. The default is a silent, fixed-tab MP4 with a 60-second limit (up to
299
- 10 minutes). Export requires an explicit `output` path on the harness host; the
300
- extension's Save As writes on the browser computer. Partial recordings and limits
301
- are reported explicitly. See the [video reference](skill/references/video.md).
1
+ # BrowserSkill for DeepSeek Harness
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@caiqy/browser-skill-dsh-plugin)](https://www.npmjs.com/package/@caiqy/browser-skill-dsh-plugin)
4
+
5
+ Use [BrowserSkill](https://github.com/Tencent/BrowserSkill) in
6
+ [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`) to browse
7
+ websites, fill forms, and capture screenshots through native `bsk_*` tools.
8
+ Browser tasks run in Agent Windows, with a live view in the dsh Web UI.
9
+
10
+ This fork publishes `0.3.3-dsh.3` as `@caiqy/browser-skill-dsh-plugin`, carrying
11
+ the local enhancements over official `0.3.3`. The official package remains
12
+ `@wxg-prc-cpg/browser-skill-dsh-plugin`. Install only one of the two packages in a
13
+ profile: they register the same `bsk_*` tools and observation routes.
14
+ See [DSH enhancement delivery notes](https://github.com/caiqy/BrowserSkill/blob/dsh/plugin-parity-0.3.3/packages/dsh-plugin-browserskill/docs/dsh-enhancement.md)
15
+ for the baseline, structured examples and actual verification boundaries.
16
+
17
+ ## Installation
18
+
19
+ Before installing the plugin:
20
+
21
+ - Install [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) and
22
+ [pnpm](https://pnpm.io/installation), which dsh uses to manage plugins.
23
+ - Install the `bsk` CLI and connect the BrowserSkill extension in Chrome or Edge.
24
+ Follow the [BrowserSkill setup guide](https://github.com/Tencent/BrowserSkill#quick-start).
25
+ - Make sure `bsk` is on the `PATH` used to start dsh, or set `bskPath` in the plugin configuration.
26
+
27
+ Install the plugin into the `web` profile, then start it:
28
+
29
+ ```sh
30
+ dsh plugin --profile web add @caiqy/browser-skill-dsh-plugin@0.3.3-dsh.3
31
+ dsh --profile web
32
+ ```
33
+
34
+ Replace `web` with your profile name if you use a different profile. The plugin
35
+ includes the complete `browser-skill` package; no separate `bsk install-skill` step is needed.
36
+ Its compact entry point loads first; references ship with the plugin and are read only
37
+ when needed. Relative paths resolve from the packaged skill directory, not your project.
38
+
39
+ In a conversation, try:
40
+
41
+ ```text
42
+ /browser-skill open example.com and summarize the page.
43
+ ```
44
+
45
+ By default, the browser tools become available when the skill is invoked.
46
+
47
+ The plugin declares support for DSH `^0.1.5-rc.3 || ^0.2.0-rc.1`.
48
+ DSH 0.2 checks these peer requirements before loading the plugin; versions outside
49
+ this range are not declared compatible. The range preserves the existing 0.1.x
50
+ baseline and admits 0.2.x without opting into future 0.3.x hosts.
51
+
52
+ ## Updating
53
+
54
+ Installed plugins do not update automatically. Install this exact fork release:
55
+
56
+ ```sh
57
+ dsh plugin --profile web add @caiqy/browser-skill-dsh-plugin@0.3.3-dsh.3
58
+ ```
59
+
60
+ To follow the fork's current release, install `@caiqy/browser-skill-dsh-plugin@dsh`.
61
+ The fork publishes prereleases under the npm `dsh` dist-tag.
62
+ See the [manual update/rollback procedure](https://github.com/caiqy/BrowserSkill/blob/dsh/plugin-parity-0.3.3/packages/dsh-plugin-browserskill/docs/dsh-enhancement.md#更新与回退).
63
+ Restart that dsh profile after upgrading. This command updates the plugin; update
64
+ the `bsk` CLI and browser extension separately when a release requires it.
65
+
66
+ ### Breaking tool API migration (0.3.3)
67
+
68
+ The coordinated 0.3.3 release replaces all six `browser_*` tool names with stable
69
+ BrowserSkill-specific names. This avoids collisions with other browser plugins
70
+ such as `dsh-builtin-browser`; both plugins keep their own tools and sessions.
71
+
72
+ | Previous name | New name |
73
+ | --- | --- |
74
+ | `browser_session` | `bsk_session` |
75
+ | `browser_page` | `bsk_page` |
76
+ | `browser_inspect` | `bsk_inspect` |
77
+ | `browser_interact` | `bsk_interact` |
78
+ | `browser_tabs` | `bsk_tabs` |
79
+ | `browser_assist` | `bsk_assist` |
80
+
81
+ The tool-name migration leaves actions, parameters, results and `/browser-skill`
82
+ unchanged. The old tool
83
+ names are not registered as aliases. After upgrading, restart the DSH profile and
84
+ invoke `/browser-skill` again in existing conversations to load the new instructions.
85
+ Update hardcoded tool calls, allow/deny lists, and `toolOrder` entries to the new
86
+ names. Do not replay old calls unchanged: another plugin may own those names.
87
+
88
+ Existing conversation logs and screenshot attachments are left intact. New
89
+ `bsk_inspect` results use the screenshot view; old `browser_inspect` cards may use
90
+ DSH's generic renderer and do not retain the custom thumbnail/preview interaction.
91
+ This is a breaking change from 0.3.2. Upgrade the CLI and browser extension to
92
+ 0.3.3 before upgrading this plugin to use the new video, extraction and element-wait
93
+ capabilities. Updating the npm package does not update either component.
94
+
95
+ ## Tools
96
+
97
+ | Tool | Actions | Purpose |
98
+ | --- | --- | --- |
99
+ | `bsk_session` | `start`, `stop`, `list`, `browsers` | Manage plugin-owned sessions; query connected browser instances. |
100
+ | `bsk_page` | `navigate`, `back`, `forward`, `reload`, `wait`, `wait-for-element`, `wait-ms` | Navigate; wait for lifecycle events, an element condition, or a fixed delay. |
101
+ | `bsk_inspect` | `observe`, `snapshot`, `html`, `screenshot`, `console`, `network`, `debug`, `video`, `extract` | Inspect page state, debug websites, capture screenshots or requested task videos, and export structured tables/lists. |
102
+ | `bsk_interact` | `click`, `hover`, `wheel`, `scroll-to`, `focus`, `blur`, `fill`, `select`, `press`, `evaluate`, `upload`, `download` | Interact with controls, evaluate page scripts and transfer local files. |
103
+ | `bsk_tabs` | `list`, `create`, `select`, `close`, `borrow`, `return` | Manage Agent Window tabs and temporarily borrow user tabs. |
104
+ | `bsk_assist` | `resize`, `emulate`, `request-help` | Resize or emulate the browser and pause for human-only steps. |
105
+
106
+ For `bsk_page` with `action: "wait-for-element"`, see the
107
+ [element-wait reference](skill/references/interaction-details.md#element-waits) for
108
+ supported conditions, timeout results and recovery with existing single actions.
109
+
110
+ For native wheel input (`action: "wheel"`), see the [wheel reference](../../docs/wheel.md)
111
+ for signed deltas, optional targets, result semantics and interruption.
112
+
113
+ For `bsk_interact` with `action: "scroll-to"`, see the
114
+ [scroll-to reference](../../docs/scroll-to.md) for parameters, visible bounds and errors.
115
+
116
+ For `bsk_inspect` with `action: "extract"`, see
117
+ [structured extraction](../../docs/structured-extraction.md) for discovery, list
118
+ fields, JSON/CSV output and loaded-DOM completeness.
119
+
120
+ Page-script evaluation is available through `bsk_interact` with `action: "evaluate"`.
121
+ The local enhancement also adds full-page screenshots, HTML file export, hover
122
+ probes, extended emulation and named sessions; see the [structured examples](docs/dsh-enhancement.md#结构化工具示例).
123
+ User interaction trace recording remains unsupported; existing task video is separate.
124
+
125
+ ### Activation failures
126
+
127
+ The six tools register as a complete suite. If any registration fails, the plugin
128
+ rolls back that attempt and reports the failing tool through DSH's logger. A model
129
+ invocation of `skill` returns an error instead of claiming successful activation;
130
+ slash-command and restored conversations receive a scoped notice. Unrelated
131
+ conversations continue normally, and repeated identical failures do not flood logs.
132
+
133
+ Resolve the reported registration error, then invoke `/browser-skill` again or
134
+ start the next turn to retry. Session entry and service discovery also retry a
135
+ pending activation; streaming events do not. The affected conversation receives
136
+ one recovery notice. If the failed model call never delivered the skill body,
137
+ the notice asks the model to load it before using the tools. With `lazyTools: false`,
138
+ a registration failure fails plugin startup and releases its resources; reload
139
+ after fixing it.
140
+
141
+ ## Multi-session model
142
+
143
+ One agent conversation can drive several browser sessions at once:
144
+
145
+ - `bsk_session` with `action: start` returns the session id and makes it the **current session**.
146
+ - Every operation tool accepts an optional `session` argument. When omitted, the call acts on the
147
+ current session (the one most recently started or used); when given, that session becomes current.
148
+ - Every tool result echoes the session it actually acted on, so the model never has to guess.
149
+ - The number of concurrent sessions started through the plugin is capped (`maxSessions`, default 5).
150
+ - Unloading the plugin stops every session it started and kills in-flight bsk processes.
151
+
152
+ Starts are journaled before creating a window. Lost replies and failed cleanup remain
153
+ recoverable on reload; `bsk_session action=list` reports `pendingCleanup`, and stop
154
+ can retry it even when there is no current session. This requires a CLI and daemon
155
+ that support recoverable starts. See [the lifecycle contract](../../docs/recoverable-session-starts.md).
156
+
157
+ Stops also retain their target and cleanup intent. A failed or interrupted stop can be
158
+ retried without accidentally stopping the next current session. Once the intent is saved,
159
+ cancelling the call only stops waiting; cleanup continues in the background. If it finishes
160
+ before a retry, that retry acknowledges the original result. With several unacknowledged
161
+ stops, pass `session` or the owned `requestId` explicitly (not both). List exposes request
162
+ IDs; stop results include `requestId` and `alreadyClosed`. Completed receipts survive reload
163
+ until acknowledged and do not occupy browser capacity.
164
+
165
+ **Ownership boundary**: the bsk daemon may be shared with other agents, terminals, or dsh
166
+ instances. The plugin therefore only ever sees and operates on sessions it created itself —
167
+ an explicit `session` argument naming a foreign or unknown id is rejected, the `list` action on
168
+ `bsk_session` shows plugin-created sessions only (no daemon-wide view), and stop/unload cleanup
169
+ can never touch a session owned by another program.
170
+
171
+ ## Configuration
172
+
173
+ After installing the plugin, edit your profile's `cordis.patch.yml`. For the `web`
174
+ profile, the default location is `~/.dsh/profiles/web/cordis.patch.yml`. If you set
175
+ `DSH_HOME`, use `$DSH_HOME/profiles/web/cordis.patch.yml` instead. Replace `web` with
176
+ your profile name as needed.
177
+
178
+ If the file contains only comments and `[]`, keep the comments and replace `[]`
179
+ with the YAML below. If it already contains patch entries, add this entry to the
180
+ existing list or edit its existing `id: browserskill` entry. Keep a single
181
+ top-level YAML list. This overrides the plugin registered by the installed bundle:
182
+
183
+ ```yaml
184
+ - id: browserskill
185
+ config:
186
+ bskPath: bsk
187
+ defaultTimeoutMs: 120000
188
+ maxSessions: 5
189
+ observationEnabled: true
190
+ thumbnailIntervalMs: 1500
191
+ idleIntervalMs: 8000
192
+ lazyTools: true
193
+ ```
194
+
195
+ Change `bskPath` to the full path of your CLI binary if it is not on dsh's `PATH`.
196
+ A patch replaces the entry's entire `config` object, so keep all overrides you need
197
+ together in that object.
198
+
199
+ Configuration changes follow `dsh.profile.patchReload` in the profile's
200
+ `package.json`: `live` (the default for `web`) applies changes when you save the
201
+ patch file; `startup` requires restarting the profile. Restart after upgrading
202
+ the plugin in either case.
203
+
204
+ All fields are optional; omitted fields use the defaults below:
205
+
206
+ | Option | Default | Purpose |
207
+ | --- | --- | --- |
208
+ | `bskPath` | `bsk` | Path to the CLI binary. |
209
+ | `sessionStateDirectory` | Scoped under `$BSK_HOME/dsh-starts` (or `~/.bsk/dsh-starts`) | Durable recovery records; optionally isolate by host/profile. |
210
+ | `defaultTimeoutMs` | `120000` | Default command execution timeout in milliseconds; output collection after exit has a separate 2-second limit. |
211
+ | `maxSessions` | `5` | Maximum concurrent sessions started by this plugin. |
212
+ | `observationEnabled` | `true` | Enable live browser observation. |
213
+ | `thumbnailIntervalMs` | `1500` | Screenshot interval for active sessions, in milliseconds. |
214
+ | `idleIntervalMs` | `8000` | Screenshot interval for idle sessions and the recent-activity window, in milliseconds. |
215
+ | `lazyTools` | `true` | Reveal the browser tools when the skill is invoked. Set `false` to register them at startup. |
216
+
217
+ With `lazyTools: true`, only the skill's catalog entry is initially advertised to
218
+ the model. A successful model `skill` call makes the six `bsk_*` schemas available
219
+ in the next step. A user `/browser-skill` gesture activates them when the host
220
+ claims the input, before prompt assembly, so the first request includes both the
221
+ skill instructions and tool schemas. Set `lazyTools: false` to register at startup.
222
+
223
+ After a plugin reload, a live or resumed conversation's successful skill invocation
224
+ restores the tools from its stored history. If an older plugin reports
225
+ `unknown tool "bsk_session"`, invoke `skill browser-skill` again, or set
226
+ `lazyTools: false` in the profile patch as a temporary workaround.
227
+
228
+ ## Live browser view
229
+
230
+ The dsh Web UI prefers a **Browser Skill** tab in DSH's native right sidebar.
231
+ The native tab opens when the current conversation first has a browser session;
232
+ ordinary screenshot and action updates do not switch tabs or reopen a tab you
233
+ closed. You can reopen it from the sidebar's guide.
234
+
235
+ The native sidebar is optional. Profiles without its services use a floating
236
+ panel, and a failed native integration falls back to that panel. No
237
+ `dsh-better-sidebar` installation is required; it can coexist with BrowserSkill,
238
+ which registers directly with DSH rather than with the third-party sidebar.
239
+
240
+ - See the current action, elapsed time, and recent screenshot for each session.
241
+ - Select a session to focus on it. The sidebar view follows the current conversation.
242
+ - Use **Use floating view** to move observation into a floating panel, and
243
+ **Move to sidebar** (or **Show here** in the tab) to return. This choice lasts
244
+ only until the page reloads; it is not saved in your profile or browser storage.
245
+ - Use **Interrupt** to cancel the current browser command. The agent may continue
246
+ with another action afterward.
247
+ - Drag or resize the floating panel, or use **Pop out** to open a Picture-in-Picture
248
+ window in browsers that support it.
249
+ - Periodic screenshots are requested while a browser observation view is visible.
250
+ Configure the active and idle intervals with the options above.
251
+
252
+ The floating panel shows all browser sessions managed by this plugin instance;
253
+ the native tab shows the current conversation's browsers and those of its subagents.
254
+
255
+ The observation endpoints require a loopback address such as `localhost` or
256
+ `127.0.0.1`. Access through a LAN hostname or non-loopback reverse proxy is not supported.
257
+
258
+ ## Development
259
+
260
+ ```sh
261
+ pnpm install
262
+ pnpm --filter @caiqy/browser-skill-dsh-plugin typecheck
263
+ pnpm --filter @caiqy/browser-skill-dsh-plugin test # unit tests mock bsk; no browser needed
264
+ pnpm --filter @caiqy/browser-skill-dsh-plugin build # tsdown -> lib/
265
+ ```
266
+
267
+ See the [development notes](https://github.com/Tencent/BrowserSkill/blob/main/packages/dsh-plugin-browserskill/docs/development.md)
268
+ for skill registration, tool results, and observation APIs in the current source.
269
+
270
+ ## Publishing
271
+
272
+ This fork is published manually from the independent BrowserSkill workspace.
273
+ Run the package's typecheck, build and tests, then `node scripts/check-dsh-package.mjs`.
274
+ Pack the built package with `npm pack --ignore-scripts` and publish the inspected
275
+ archive with `npm publish <archive.tgz> --access public --tag dsh --registry=https://registry.npmjs.org/`.
276
+
277
+ Publish only `@caiqy/browser-skill-dsh-plugin`; the official
278
+ `@wxg-prc-cpg/browser-skill-dsh-plugin` package is maintained upstream.
279
+ Use the `caiqy-dsh-plugin-v<version>` tag for fork releases, which does not trigger
280
+ the inherited upstream release workflow. Push the fork commit before updating the
281
+ parent workspace's submodule pointer and market index.
282
+
283
+ Keep the official 0.3.3 CLI and extension installed separately. Publishing this
284
+ plugin does not update those components. Published npm versions cannot be overwritten.
285
+
286
+ ## License
287
+
288
+ MIT
289
+
290
+ ## Task video recording
291
+
292
+ Ask the agent to record before it performs the task. It starts an authorized task
293
+ tab, confirms recording is active, performs the task, then stops video before
294
+ ending the session. No manual Start click is required. Preview and Save As are in
295
+ the extension's Features → Video recording → Recent recordings.
296
+
297
+ `bsk_inspect` with `action: "video"` exposes `videoAction` start/status/stop/save/
298
+ list/discard. The default is a silent, fixed-tab MP4 with a 60-second limit (up to
299
+ 10 minutes). Export requires an explicit `output` path on the harness host; the
300
+ extension's Save As writes on the browser computer. Partial recordings and limits
301
+ are reported explicitly. See the [video reference](skill/references/video.md).
package/cordis.patch.yml CHANGED
@@ -1,5 +1,5 @@
1
- - insert:
2
- - id: browserskill
3
- # Must be the published package name — the loader imports this specifier.
4
- # Quoted because YAML reserves a leading '@' in plain scalars.
5
- name: "@caiqy/browser-skill-dsh-plugin"
1
+ - insert:
2
+ - id: browserskill
3
+ # Must be the published package name — the loader imports this specifier.
4
+ # Quoted because YAML reserves a leading '@' in plain scalars.
5
+ name: "@caiqy/browser-skill-dsh-plugin"