kimi-webbridge-dsh 1.4.6 → 1.4.7
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 +6 -5
- package/lib/index.js +13 -3
- package/package.json +2 -2
- package/skill.md +13 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Kimi WebBridge 的 dsh 插件(**基础设施 + 技能注册**)。插件本身不代理浏览器操作,而是负责:
|
|
4
4
|
|
|
5
5
|
1. **保障桥完好**:守护进程二进制缺失时自动从官方 CDN 下载(跨平台、SHA-256 校验),守护进程未运行时自动拉起;
|
|
6
|
-
2. **注册 skill**:启动时把随包内置的 `skill.md` 注册为运行时 skill(`ctx.skills.register`,`source: bundled`),模型通过 `skill` 工具加载它,按文档用 HTTP 行使全部浏览器能力(
|
|
6
|
+
2. **注册 skill**:启动时把随包内置的 `skill.md` 注册为运行时 skill(`ctx.skills.register`,`source: bundled`),模型通过 `skill` 工具加载它,按文档用 HTTP 行使全部浏览器能力(25 个动作);
|
|
7
7
|
3. **注册一个瘦工具 `kimi_webbridge`**:只有 `status` 一个动作(守护进程 + 扩展健康检查),作为其他 skill(如 x-cli 系列)的桥健康锚点。
|
|
8
8
|
|
|
9
9
|
## 架构
|
|
@@ -11,7 +11,7 @@ Kimi WebBridge 的 dsh 插件(**基础设施 + 技能注册**)。插件本
|
|
|
11
11
|
| 层 | 角色 |
|
|
12
12
|
|---|---|
|
|
13
13
|
| 插件(本包) | 守护进程二进制供应 + 自动启动;apply() 时注册运行时 skill |
|
|
14
|
-
| skill(运行时注册,随包内置 `skill.md`) | 模型经 `skill` 工具加载,按文档驱动守护进程:navigate / find_tab / snapshot / click / mouse_click / fill / key_type / send_keys / evaluate / cdp / screenshot / network / upload / save_as_pdf / list_tabs / close_tab / close_session |
|
|
14
|
+
| skill(运行时注册,随包内置 `skill.md`) | 模型经 `skill` 工具加载,按文档驱动守护进程:navigate / find_tab / snapshot / read_page / find / click / mouse_click / hover / drag / fill / key_type / send_keys / select_option / dialog / evaluate / cdp / screenshot / network / upload / save_as_pdf / scroll / wait / list_tabs / close_tab / close_session |
|
|
15
15
|
| 瘦工具 `kimi_webbridge` | 仅 `status` 健康检查(自带守护进程自愈) |
|
|
16
16
|
|
|
17
17
|
## 安装(一次性,零手工配置)
|
|
@@ -58,16 +58,17 @@ dsh plugin --profile web add kimi-webbridge-dsh
|
|
|
58
58
|
|
|
59
59
|
下载流程:先落盘为临时文件(`kimi-webbridge(.exe).tmp-{pid}-{时间戳}`)→ SHA-256 与官方清单核对 → 匹配才重命名为最终路径;不匹配则删除临时文件并中止,任何未验证的二进制都不会留在磁盘。该路径与官方安装器 / `kimi-webbridge upgrade` 命令完全一致,插件、官方工具共用同一份守护进程。
|
|
60
60
|
|
|
61
|
-
## 功能(skill 承载,
|
|
61
|
+
## 功能(skill 承载,25 个动作)
|
|
62
62
|
|
|
63
63
|
| 能力 | 动作 |
|
|
64
64
|
|---|---|
|
|
65
65
|
| 导航 / 标签 | `navigate`、`find_tab`、`list_tabs`、`close_tab`、`close_session` |
|
|
66
|
-
| 读页面 | `snapshot`(accessibility tree + `@e`
|
|
67
|
-
| 点击 / 输入 | `click`、`mouse_click`(真实鼠标,可信输入)、`fill`、`key_type`(键入,可信)、`send_keys
|
|
66
|
+
| 读页面 | `snapshot`(accessibility tree + `@e` 引用)、`read_page`(全文文本)、`find`(页面内搜索) |
|
|
67
|
+
| 点击 / 输入 | `click`、`mouse_click`(真实鼠标,可信输入)、`hover`、`drag`、`fill`、`key_type`(键入,可信)、`send_keys`(组合键)、`select_option`、`dialog` |
|
|
68
68
|
| JS / CDP | `evaluate`(页面上下文)、`cdp`(chrome.debugger 直通) |
|
|
69
69
|
| 截图 / PDF | `screenshot`、`save_as_pdf`(写文件、返回路径) |
|
|
70
70
|
| 网络 / 上传 | `network`(请求捕获)、`upload`(文件上传) |
|
|
71
|
+
| 滚动 / 等待 | `scroll`(滚动/定位)、`wait`(等待文本/选择器条件) |
|
|
71
72
|
| 会话分组 | 一个任务 = 一个 session = 一个标签页组,可一键清理 |
|
|
72
73
|
|
|
73
74
|
## 配置(可选)
|
package/lib/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { fileURLToPath } from "node:url";
|
|
|
17
17
|
* Infrastructure-only bridge plugin:
|
|
18
18
|
* - provisions the daemon binary (official Kimi CDN, SHA-256 verified) and
|
|
19
19
|
* auto-starts it, keeping the bridge healthy;
|
|
20
|
-
* - registers the packaged skill.md (the full
|
|
20
|
+
* - registers the packaged skill.md (the full 25-action HTTP protocol for
|
|
21
21
|
* driving the user's real browser) as a runtime skill via ctx.skills;
|
|
22
22
|
* - registers one thin tool `kimi_webbridge` whose only action is `status`
|
|
23
23
|
* (daemon + extension health check) as an anchor for other skills.
|
|
@@ -323,7 +323,7 @@ function apply(ctx, config = {}) {
|
|
|
323
323
|
|
|
324
324
|
ctx.tools.register(defineTool({
|
|
325
325
|
name: "kimi_webbridge",
|
|
326
|
-
description: "Health check for the local kimi-webbridge bridge (daemon at " + baseUrl + " and the browser extension). The plugin auto-provisions the daemon: it installs the binary from the official Kimi CDN when missing and starts it, then retries once. Returns daemon version/uptime and
|
|
326
|
+
description: "Health check for the local kimi-webbridge bridge (daemon at " + baseUrl + " and the browser extension). The plugin auto-provisions the daemon: it installs the binary from the official Kimi CDN when missing and starts it, then retries once. Returns daemon version/uptime, extension_connected, plus version (daemon) and extension_version (extension) — a mismatch means the components have drifted (the extension likely auto-updated). This tool does NOT perform browser actions — for navigation, clicking, typing, reading pages, screenshots, JS evaluation, CDP, uploads, PDF export and tab management, load the kimi-webbridge skill, which documents the full 25-action HTTP protocol (POST " + baseUrl + "/command) to drive the user's real browser.",
|
|
327
327
|
parameters: {
|
|
328
328
|
action: {
|
|
329
329
|
type: "string",
|
|
@@ -338,7 +338,17 @@ function apply(ctx, config = {}) {
|
|
|
338
338
|
additionalProperties: true
|
|
339
339
|
},
|
|
340
340
|
render(args, value) {
|
|
341
|
-
|
|
341
|
+
const blocks = [{ type: "text", text: JSON.stringify(value) }];
|
|
342
|
+
const norm = (s) => (typeof s === "string" ? s.replace(/^v/i, "") : "");
|
|
343
|
+
const daemonVer = norm(value?.version);
|
|
344
|
+
const extVer = norm(value?.extension_version);
|
|
345
|
+
if (daemonVer && extVer && daemonVer !== extVer) {
|
|
346
|
+
blocks.push({
|
|
347
|
+
type: "text",
|
|
348
|
+
text: `⚠️ version drift: daemon ${value.version} vs extension ${value.extension_version} — the browser extension likely auto-updated. Re-audit the 25-action skill list and update the daemon.`
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
return blocks;
|
|
342
352
|
}
|
|
343
353
|
},
|
|
344
354
|
isConcurrencySafe() {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kimi-webbridge-dsh",
|
|
3
|
-
"description": "Infrastructure plugin for dsh: provisions the kimi-webbridge daemon (auto-install with SHA-256 verification, auto-start) and registers the kimi-webbridge skill that documents the full
|
|
4
|
-
"version": "1.4.
|
|
3
|
+
"description": "Infrastructure plugin for dsh: provisions the kimi-webbridge daemon (auto-install with SHA-256 verification, auto-start) and registers the kimi-webbridge skill that documents the full 25-action browser protocol. Registers a thin kimi_webbridge tool (status health check only).",
|
|
4
|
+
"version": "1.4.7",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [
|
package/skill.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Control the user's real browser (their login sessions) through the local daemon at `http://127.0.0.1:10086`.
|
|
4
4
|
|
|
5
|
-
> This skill is registered by the `kimi-webbridge-dsh` plugin (plugin v1.4.
|
|
5
|
+
> This skill is registered by the `kimi-webbridge-dsh` plugin (plugin v1.4.7 / daemon v2.0.1). Do not hand-edit it.
|
|
6
6
|
|
|
7
7
|
## Health check first
|
|
8
8
|
|
|
9
9
|
Before driving the browser, call the **`kimi_webbridge` tool with action `status`**. It reports daemon + extension health and auto-provisions the daemon (downloads the binary from the official Kimi CDN when missing and starts it, then retries once). `extension_connected: true` means the browser extension is ready; if false, tell the user to install/connect the Kimi WebBridge extension.
|
|
10
10
|
|
|
11
|
-
## The
|
|
11
|
+
## The 25 actions
|
|
12
12
|
|
|
13
13
|
Every action is one HTTP call: `POST http://127.0.0.1:10086/command` with body `{"action": "<name>", "args": {...}, "session": "<task-name>"}`.
|
|
14
14
|
|
|
@@ -31,6 +31,14 @@ Every action is one HTTP call: `POST http://127.0.0.1:10086/command` with body `
|
|
|
31
31
|
| `list_tabs` | — | `{success, tabs:[{tabId,url,title,active,groupTitle}]}` | |
|
|
32
32
|
| `close_tab` | — | `{success, closed}` | |
|
|
33
33
|
| `close_session` | — | `{success, closed}` | close all session tabs — only when the user asks |
|
|
34
|
+
| `read_page` | `max_chars?`, `start?` | `{text, complete, screens, chars}` | readable page text, paged — pass `start` to continue when `complete:false` |
|
|
35
|
+
| `find` | `query` | `{url, title, matches}` | search the page (accessibility tree) for a text query |
|
|
36
|
+
| `scroll` | `direction?` up/down, `to?` top/bottom, `selector?`, `text?` | `{scrolled, direction, atTop, atBottom, scrollY}` | scroll the page or an element into view |
|
|
37
|
+
| `hover` | `selector` (`@e` or CSS) | `{success, x, y, tag, text}` | hover over an element |
|
|
38
|
+
| `drag` | `from`, `to` (`@e`/CSS) | `{success, dispatched, verified, dropAccepted}` | HTML5 drag-and-drop from→to |
|
|
39
|
+
| `select_option` | `selector`, `values` (or `value`) | `{success, ...}` | pick options in a native `<select>`; custom dropdowns → click |
|
|
40
|
+
| `dialog` | `action` status/accept/dismiss, `text?` | `{open, type, message}` / `{success, action}` | handle JS dialogs (alert/confirm/prompt) |
|
|
41
|
+
| `wait` | `text?`, `text_gone?`, `selector?`, `timeout_ms?` | `{ok, ...}` / `{ok:false, timedOut, waitedMs}` | wait for a condition (text appears/disappears, selector visible) |
|
|
34
42
|
|
|
35
43
|
## Sending requests (shell-proof)
|
|
36
44
|
|
|
@@ -63,6 +71,8 @@ Call `close_session` only when the user explicitly asks to close the tabs.
|
|
|
63
71
|
- Trusted input: on sites that reject synthetic events (`event.isTrusted` checks — banking portals, captchas), use `mouse_click` instead of `click` and `key_type`/`send_keys` instead of `fill`. If those still fail, tell the user the page needs manual interaction.
|
|
64
72
|
- `send_keys` keys: Enter/Return, Escape/Esc, Tab, Backspace, Delete, Space, ArrowUp/Down/Left/Right, Home/End, PageUp/PageDown, F1–F12, single letters/digits. Modifiers: Alt/Ctrl/Control/Cmd/Meta/Shift, or `Mod` (Cmd on Mac, Ctrl elsewhere). Join with `+` ("Mod+A", "Shift+Tab"); space-separate several ("Enter Escape").
|
|
65
73
|
- Cross-origin iframes are not covered — navigate to the iframe URL directly.
|
|
74
|
+
- `read_page` returns the full readable page text (paged — follow `start` when `complete:false`); `find` searches the page text for a query. Both are text readers; `snapshot` is still how you get `@e` refs for interaction.
|
|
75
|
+
- `scroll` (direction/to/selector/text), `hover`, `drag` (from→to), `select_option` (native `<select>` only), and `dialog` (status/accept/dismiss) cover page interaction; `wait` blocks until a condition (text/selector) is met instead of blind sleeps.
|
|
66
76
|
|
|
67
77
|
## Screenshots and PDF
|
|
68
78
|
|
|
@@ -73,6 +83,7 @@ Call `close_session` only when the user explicitly asks to close the tabs.
|
|
|
73
83
|
- Call the `kimi_webbridge` tool (`status`) — the plugin auto-provisions and starts the daemon. Never run `stop` / `restart` / `uninstall` yourself.
|
|
74
84
|
- If an error mentions "Please update the Kimi WebBridge extension", the extension is outdated — ask the user to update it (https://www.kimi.com/features/webbridge).
|
|
75
85
|
- If the daemon stays unreachable after the status tool's retry, point the user to the help page instead of deep-troubleshooting.
|
|
86
|
+
- If the status tool warns that `version` (daemon) and `extension_version` (extension) differ, the extension has drifted (likely auto-updated) — re-audit the 25-action list above and ask the user to update the daemon.
|
|
76
87
|
|
|
77
88
|
---
|
|
78
89
|
|