kimi-webbridge-dsh 1.1.0 → 1.3.0
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 +26 -31
- package/cordis.patch.yml +7 -0
- package/lib/index.js +8 -2
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -1,59 +1,53 @@
|
|
|
1
1
|
# kimi-webbridge-dsh
|
|
2
2
|
|
|
3
|
-
Kimi WebBridge 的 dsh 插件:通过本机 kimi-webbridge 守护进程(`127.0.0.1:10086
|
|
3
|
+
Kimi WebBridge 的 dsh 插件:通过本机 kimi-webbridge 守护进程(`127.0.0.1:10086`)驱动用户的真实浏览器(保留登录态与 Cookie)。注册一个模型工具 `kimi_webbridge`,覆盖导航、点击、输入、读取页面(accessibility tree + @e 引用)、截图、JS 求值、CDP、网络、上传、PDF 导出、标签页与会话管理。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 功能
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
| 能力 | 说明 |
|
|
8
|
+
|---|---|
|
|
9
|
+
| 浏览真实页面 | 在用户已登录的浏览器中导航、点击、填表、滚动 |
|
|
10
|
+
| 读页面 | `snapshot` 返回 accessibility tree 与 `@e` 元素引用 |
|
|
11
|
+
| 截图 / 导出 PDF | 结果写入本地文件,返回路径 |
|
|
12
|
+
| JS 求值 / CDP | `evaluate`(页面上下文)、`cdp`(chrome.debugger 直通) |
|
|
13
|
+
| 网络 / 上传 | 请求捕获与文件上传 |
|
|
14
|
+
| 会话分组 | 一个任务 = 一个 session = 一个标签页组,可一键清理 |
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
- 浏览器扩展已连接(`kimi-webbridge status` 显示 `extension_connected: true`)
|
|
16
|
+
## 依赖
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
- **浏览器扩展**:需安装并连接 Kimi WebBridge 浏览器扩展 —— 从 [Chrome Web Store](https://chromewebstore.google.com/detail/kimi-webbridge/fldmhceldgbpfpkbgopacenieobmligc) 安装(`kimi-webbridge status` 显示 `extension_connected: true`;扩展版本应与守护进程一致)。
|
|
19
|
+
- **守护进程**:无需预装。插件在守护进程不可达时会自动启动它;二进制缺失时会自动从官方 CDN(cdn.kimi.com,与官方安装器同源)下载安装——全程无需手动运行任何安装命令。
|
|
13
20
|
|
|
14
|
-
|
|
21
|
+
## 安装(一次性,零手工配置)
|
|
15
22
|
|
|
16
23
|
```powershell
|
|
17
24
|
dsh plugin --profile web add kimi-webbridge-dsh
|
|
18
25
|
```
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
本包声明了 `dsh.bundle.patch`:`dsh plugin add` 会自动把它登记进 profile 的 bundle 层(`dsh.profile.bundles`),**无需手动编辑任何 cordis.patch.yml**。安装后重启一次 dsh web 即生效(bundle 在启动时加载):
|
|
21
28
|
|
|
22
29
|
```powershell
|
|
23
|
-
dsh
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
两种方式安装后,都需要把下面这段追加到 `~/.dsh/profiles/web/cordis.patch.yml`(用户补丁层,热重载生效,无需重启服务):
|
|
27
|
-
|
|
28
|
-
```yaml
|
|
29
|
-
- insert:
|
|
30
|
-
- id: kimi-webbridge
|
|
31
|
-
name: kimi-webbridge-dsh
|
|
30
|
+
dsh web
|
|
32
31
|
```
|
|
33
32
|
|
|
34
33
|
## 用法
|
|
35
34
|
|
|
36
35
|
模型在新会话中可直接调用 `kimi_webbridge` 工具。核心规则:
|
|
37
36
|
|
|
38
|
-
- **一个任务 = 一个 session = 一个标签页组**:任务开始时选一个 session
|
|
37
|
+
- **一个任务 = 一个 session = 一个标签页组**:任务开始时选一个 session 名,之后每次调用都带上(如 `camping-research`)。
|
|
39
38
|
- **读页面用 snapshot**:返回 accessibility tree 和 `@e` 引用,点击/输入优先用 `@e` 引用而非手写 CSS。
|
|
40
39
|
- **截图返回文件路径**:用 read 工具打开查看。
|
|
41
|
-
-
|
|
40
|
+
- **守护进程不可达**:工具会自动启动;二进制缺失时自动从官方 CDN 下载安装。
|
|
42
41
|
|
|
43
42
|
## 配置(可选)
|
|
44
43
|
|
|
45
|
-
在
|
|
44
|
+
在 profile 的用户补丁层(`~/.dsh/profiles/web/cordis.patch.yml`)按 id 覆盖配置(替换整份 config,未给出的键取默认值):
|
|
46
45
|
|
|
47
46
|
```yaml
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
baseUrl: http://127.0.0.1:10086
|
|
53
|
-
requestTimeoutMs: 120000
|
|
54
|
-
autoStartDaemon: true
|
|
55
|
-
autoInstallDaemon: true
|
|
56
|
-
daemonVersion: latest
|
|
47
|
+
- id: kimi-webbridge
|
|
48
|
+
config:
|
|
49
|
+
autoInstallDaemon: false
|
|
50
|
+
daemonVersion: 0.3.0
|
|
57
51
|
```
|
|
58
52
|
|
|
59
53
|
| 配置项 | 默认值 | 说明 |
|
|
@@ -61,7 +55,7 @@ dsh plugin --profile web add E:\deepseek\kimi-webbridge-dsh
|
|
|
61
55
|
| `baseUrl` | `http://127.0.0.1:10086` | 守护进程地址 |
|
|
62
56
|
| `requestTimeoutMs` | `120000` | 单次请求超时(毫秒) |
|
|
63
57
|
| `autoStartDaemon` | `true` | 守护进程未运行时自动启动 |
|
|
64
|
-
| `autoInstallDaemon` | `true` | 二进制缺失时自动从官方 CDN 下载安装(关闭后需手动运行 `irm https://cdn.kimi.com/webbridge/install.ps1
|
|
58
|
+
| `autoInstallDaemon` | `true` | 二进制缺失时自动从官方 CDN 下载安装(关闭后需手动运行 `irm https://cdn.kimi.com/webbridge/install.ps1 | iex`) |
|
|
65
59
|
| `daemonVersion` | `latest` | 自动安装时的版本(可固定如 `0.3.0`) |
|
|
66
60
|
|
|
67
61
|
## 移除
|
|
@@ -69,4 +63,5 @@ dsh plugin --profile web add E:\deepseek\kimi-webbridge-dsh
|
|
|
69
63
|
```powershell
|
|
70
64
|
dsh plugin --profile web remove kimi-webbridge-dsh
|
|
71
65
|
```
|
|
72
|
-
|
|
66
|
+
|
|
67
|
+
自动从 bundle 层移除(无需手动删补丁行),重启后生效。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# kimi-webbridge-dsh bundle patch: applied automatically by the dsh profile
|
|
2
|
+
# loader once this package is registered as a bundle via
|
|
3
|
+
# dsh plugin --profile <name> add kimi-webbridge-dsh
|
|
4
|
+
# No manual cordis.patch.yml editing is required.
|
|
5
|
+
- insert:
|
|
6
|
+
- id: kimi-webbridge
|
|
7
|
+
name: kimi-webbridge-dsh
|
package/lib/index.js
CHANGED
|
@@ -253,7 +253,13 @@ function canonicalResult(result) {
|
|
|
253
253
|
* section in the system prompt.
|
|
254
254
|
*/
|
|
255
255
|
function apply(ctx, config = {}) {
|
|
256
|
-
const {
|
|
256
|
+
const {
|
|
257
|
+
baseUrl = "http://127.0.0.1:10086",
|
|
258
|
+
requestTimeoutMs = 120000,
|
|
259
|
+
autoStartDaemon = true,
|
|
260
|
+
autoInstallDaemon = true,
|
|
261
|
+
daemonVersion = "latest"
|
|
262
|
+
} = config;
|
|
257
263
|
|
|
258
264
|
ctx.systemPrompt.section({
|
|
259
265
|
name: "tool:kimi-webbridge",
|
|
@@ -263,7 +269,7 @@ function apply(ctx, config = {}) {
|
|
|
263
269
|
|
|
264
270
|
ctx.tools.register(defineTool({
|
|
265
271
|
name: "kimi_webbridge",
|
|
266
|
-
description: "Drive the user's real browser (with their login sessions) via the local kimi-webbridge daemon at " + baseUrl + ". The browser extension must be connected (status shows extension_connected). One task = one session = one tab group: pick a session name at the start of a task and pass it on every call. Actions: status (daemon + extension health); navigate {url, newTab?, group_title?} (first call opens a tab); find_tab {url, active?} (re-select a session tab, or borrow the user's active tab); snapshot (accessibility tree with @e refs — use it to read content and locate elements); click {selector} (@e ref or CSS); fill {selector, value} (inputs, textareas, and contenteditable editors; clear-and-insert); evaluate {code} (async JS in the page realm; wrap re-declarations in an IIFE; return compact JSON); cdp {method, params} (raw chrome.debugger passthrough); screenshot {format?, quality?, selector?, path?} (returns a file path — open it with the read tool to see it); network {cmd, filter?, requestId?}; upload {selector, files}; save_as_pdf {paper_format?, landscape?, scale?, print_background?, path?}; list_tabs; close_tab; close_session (only when the user asks to close the tabs). Prefer @e refs from snapshot over hand-written CSS selectors. When the daemon is unreachable the plugin starts it automatically; if the daemon binary is missing it is downloaded from the official Kimi CDN (config autoInstallDaemon:false disables this).",
|
|
272
|
+
description: "Drive the user's real browser (with their login sessions) via the local kimi-webbridge daemon at " + baseUrl + ". The browser extension must be connected (status shows extension_connected). One task = one session = one tab group: pick a session name at the start of a task and pass it on every call. Actions: status (daemon + extension health); navigate {url, newTab?, group_title?} (first call opens a tab); find_tab {url, active?} (re-select a session tab, or borrow the user's active tab); snapshot (accessibility tree with @e refs — use it to read content and locate elements); click {selector} (@e ref or CSS); fill {selector, value} (inputs, textareas, and contenteditable editors; clear-and-insert); evaluate {code} (async JS in the page realm; wrap re-declarations in an IIFE; return compact JSON); cdp {method, params} (raw chrome.debugger passthrough); screenshot {format?, quality?, selector?, path?} (returns a file path — open it with the read tool to see it); network {cmd, filter?, requestId?}; upload {selector, files}; save_as_pdf {paper_format?, landscape?, scale?, print_background?, path?}; list_tabs; close_tab; close_session (only when the user asks to close the tabs). Prefer @e refs from snapshot over hand-written CSS selectors. When the daemon is unreachable the plugin starts it automatically; if the daemon binary is missing it is downloaded from the official Kimi CDN (config autoInstallDaemon:false disables this). Limits: sites that strictly check event.isTrusted (some banking portals, captchas) ignore click/fill — tell the user the page needs manual interaction; cross-origin iframes are not covered by fill/click/snapshot/evaluate — navigate to the iframe URL directly; if an error says 'Please update the Kimi WebBridge extension', the extension is outdated — ask the user to update it and retry.",
|
|
267
273
|
parameters: {
|
|
268
274
|
action: {
|
|
269
275
|
type: "string",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kimi-webbridge-dsh",
|
|
3
3
|
"description": "Kimi WebBridge plugin for dsh: drive the user's real browser (their login sessions) through the local kimi-webbridge daemon at 127.0.0.1:10086. Registers a single kimi_webbridge tool covering navigate, click, fill, snapshot, screenshot, evaluate, cdp, network, upload, save_as_pdf, tab and session management.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [
|
|
@@ -24,9 +24,15 @@
|
|
|
24
24
|
},
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
|
+
"dsh": {
|
|
28
|
+
"bundle": {
|
|
29
|
+
"patch": "./cordis.patch.yml"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
27
32
|
"files": [
|
|
28
33
|
"lib/index.js",
|
|
29
|
-
"README.md"
|
|
34
|
+
"README.md",
|
|
35
|
+
"cordis.patch.yml"
|
|
30
36
|
],
|
|
31
37
|
"dependencies": {
|
|
32
38
|
"@deepseek-ai/schemastery": "^3.18.1",
|