@sleepinsummer/agent-browser-cli 0.2.1 → 0.2.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 +30 -3
- package/README_EN.md +29 -2
- package/package.json +12 -4
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<a href="https://github.com/sleepinginsummer/agent-browser-cli"><img src="https://img.shields.io/badge/CLI-agentbrowsercli-2ea44f" alt="CLI agentbrowsercli"></a>
|
|
11
11
|
<a href="https://github.com/sleepinginsummer/agent-browser-cli/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License MIT"></a>
|
|
12
12
|
<a href="https://github.com/sleepinginsummer/agent-browser-cli"><img src="https://img.shields.io/badge/Windows-MacOS-0078D6?labelColor=0078D6&color=C0C0C0" alt="Windows/MacOS"></a>
|
|
13
|
-
<a href="https://github.com/sleepinginsummer/agent-browser-cli/releases"><img src="https://img.shields.io/badge/release-v0.2.
|
|
13
|
+
<a href="https://github.com/sleepinginsummer/agent-browser-cli/releases"><img src="https://img.shields.io/badge/release-v0.2.3-blue" alt="release v0.2.3"></a>
|
|
14
14
|
<a href="https://github.com/sleepinginsummer/agent-browser-cli/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen" alt="PRs welcome"></a>
|
|
15
15
|
</p>
|
|
16
16
|
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
## 项目信息
|
|
28
28
|
|
|
29
|
-
- 当前版本:`0.2.
|
|
30
|
-
- 支持平台:
|
|
29
|
+
- 当前版本:`0.2.3`
|
|
30
|
+
- 支持平台:sys win/mac
|
|
31
31
|
- 浏览器:Chrome / Chromium,需加载 `assets/tmwd_cdp_bridge`
|
|
32
32
|
|
|
33
33
|
## 致谢
|
|
@@ -51,6 +51,33 @@
|
|
|
51
51
|
- 若干优化,缩短命令执行时间
|
|
52
52
|
- rust实现cli端
|
|
53
53
|
|
|
54
|
+
## 性能参考
|
|
55
|
+
|
|
56
|
+
以下为常驻服务已启动、Chrome 扩展已连接时的实测参考,实际耗时会受页面复杂度、网络、Chrome 状态和返回数据量影响。
|
|
57
|
+
|
|
58
|
+
| 操作 | 参考耗时 |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| 打开百度标签页 | 约 `0.10s` |
|
|
61
|
+
| 注入 JS 输入关键词并点击搜索 | 约 `0.27s` |
|
|
62
|
+
| 打开百度并搜索“小猫”合计 | 约 `0.37s` |
|
|
63
|
+
| `scan --tab --text-only` 读取页面文本 | 约 `0.04-0.12s` |
|
|
64
|
+
| `exec 'return document.title'` 注入简单 JS | 约 `0.04-0.12s` |
|
|
65
|
+
| `exec 'return document.body.innerText'` 读取正文 | 多数 `0.04-0.05s`,偶发约 `0.30s` |
|
|
66
|
+
| 查询 DOM 链接列表 | 约 `0.27-0.36s` |
|
|
67
|
+
| `exec --monitor` 页面变化摘要 | 约 `0.72-0.88s` |
|
|
68
|
+
|
|
69
|
+
一般判断:普通读页面和简单 JS 注入是 `50ms` 级;复杂 DOM 查询主要取决于页面结构和返回数据量,常见约 `300ms`;`--monitor` 会额外生成页面变化摘要,通常接近 `0.8s`。
|
|
70
|
+
|
|
71
|
+
与原 Python 调用链的参考对比:
|
|
72
|
+
|
|
73
|
+
| 对比项 | Python 版本 | Rust CLI 版本 |
|
|
74
|
+
| --- | --- | --- |
|
|
75
|
+
| 启动方式 | 每次调用更容易触发 Python 进程、模块加载和连接初始化开销 | CLI 命令复用常驻服务,避免重复初始化浏览器连接 |
|
|
76
|
+
| 简单读页面 / JS 注入 | 通常受进程启动和 Python 调用链影响,延迟更不稳定 | 常见 `0.04-0.12s` |
|
|
77
|
+
| 连续多次调用 | 多次短命令开销更明显 | 更适合 Agent 高频调用 |
|
|
78
|
+
|
|
79
|
+
该对比只用于说明架构差异带来的性能趋势;具体耗时仍取决于页面复杂度、Chrome 状态和返回数据量。
|
|
80
|
+
|
|
54
81
|
## 目录结构
|
|
55
82
|
|
|
56
83
|
```text
|
package/README_EN.md
CHANGED
|
@@ -10,7 +10,7 @@ Browser perception · Page control · Chrome session reuse · CDP · Conditional
|
|
|
10
10
|
<a href="https://github.com/sleepinginsummer/agent-browser-cli"><img src="https://img.shields.io/badge/CLI-agentbrowsercli-2ea44f" alt="CLI agentbrowsercli"></a>
|
|
11
11
|
<a href="https://github.com/sleepinginsummer/agent-browser-cli/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License MIT"></a>
|
|
12
12
|
<a href="https://github.com/sleepinginsummer/agent-browser-cli"><img src="https://img.shields.io/badge/Windows-MacOS-0078D6?labelColor=0078D6&color=C0C0C0" alt="Windows/MacOS"></a>
|
|
13
|
-
<a href="https://github.com/sleepinginsummer/agent-browser-cli/releases"><img src="https://img.shields.io/badge/release-v0.2.
|
|
13
|
+
<a href="https://github.com/sleepinginsummer/agent-browser-cli/releases"><img src="https://img.shields.io/badge/release-v0.2.3-blue" alt="release v0.2.3"></a>
|
|
14
14
|
<a href="https://github.com/sleepinginsummer/agent-browser-cli/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen" alt="PRs welcome"></a>
|
|
15
15
|
</p>
|
|
16
16
|
|
|
@@ -26,7 +26,7 @@ This project is not Selenium or Playwright. It is better suited for helping agen
|
|
|
26
26
|
|
|
27
27
|
## Project Info
|
|
28
28
|
|
|
29
|
-
- Current version: `0.2.
|
|
29
|
+
- Current version: `0.2.3`
|
|
30
30
|
- Supported platforms: Windows, macOS
|
|
31
31
|
- Browser: Chrome / Chromium, with `assets/tmwd_cdp_bridge` loaded
|
|
32
32
|
|
|
@@ -51,6 +51,33 @@ Please read https://github.com/sleepinginsummer/agent-browser-cli/blob/main/AI_I
|
|
|
51
51
|
- Includes several optimizations to reduce command execution time.
|
|
52
52
|
- Rust implementation for the CLI side.
|
|
53
53
|
|
|
54
|
+
## Performance Reference
|
|
55
|
+
|
|
56
|
+
The following numbers are measured with the long-lived service already running and the Chrome extension already connected. Actual latency depends on page complexity, network conditions, Chrome state, and response size.
|
|
57
|
+
|
|
58
|
+
| Operation | Reference Latency |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| Open a Baidu tab | About `0.10s` |
|
|
61
|
+
| Inject JS to enter a keyword and submit search | About `0.27s` |
|
|
62
|
+
| Open Baidu and search “小猫” end-to-end | About `0.37s` |
|
|
63
|
+
| `scan --tab --text-only` to read page text | About `0.04-0.12s` |
|
|
64
|
+
| `exec 'return document.title'` for simple JS | About `0.04-0.12s` |
|
|
65
|
+
| `exec 'return document.body.innerText'` to read body text | Mostly `0.04-0.05s`, occasional `0.30s` |
|
|
66
|
+
| Query DOM link lists | About `0.27-0.36s` |
|
|
67
|
+
| `exec --monitor` page-change summary | About `0.72-0.88s` |
|
|
68
|
+
|
|
69
|
+
Rule of thumb: normal page reads and simple JS injection are around the `50ms` level; complex DOM queries depend on page structure and returned data size, commonly around `300ms`; `--monitor` adds page-change summary work and is usually close to `0.8s`.
|
|
70
|
+
|
|
71
|
+
Reference comparison with the original Python call chain:
|
|
72
|
+
|
|
73
|
+
| Item | Python Version | Rust CLI Version |
|
|
74
|
+
| --- | --- | --- |
|
|
75
|
+
| Startup model | Each call is more likely to pay for Python process startup, module loading, and connection initialization | CLI commands reuse the long-lived service and avoid repeated browser connection initialization |
|
|
76
|
+
| Simple page read / JS injection | Usually more affected by process startup and the Python call chain, so latency is less stable | Commonly `0.04-0.12s` |
|
|
77
|
+
| Repeated calls | Overhead is more visible across many short commands | Better suited for high-frequency Agent calls |
|
|
78
|
+
|
|
79
|
+
This comparison is intended to describe the performance trend caused by the architecture difference. Actual latency still depends on page complexity, Chrome state, and response size.
|
|
80
|
+
|
|
54
81
|
## Layout
|
|
55
82
|
|
|
56
83
|
```text
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleepinsummer/agent-browser-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Agent-oriented browser sensing and control CLI backed by a native Rust daemon.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -21,11 +21,19 @@
|
|
|
21
21
|
"postinstall": "node npm/postinstall.js"
|
|
22
22
|
},
|
|
23
23
|
"optionalDependencies": {
|
|
24
|
-
"@sleepinsummer/agent-browser-cli-darwin-arm64": "0.2.
|
|
25
|
-
"@sleepinsummer/agent-browser-cli-darwin-x64": "0.2.
|
|
26
|
-
"@sleepinsummer/agent-browser-cli-win32-x64": "0.2.
|
|
24
|
+
"@sleepinsummer/agent-browser-cli-darwin-arm64": "0.2.3",
|
|
25
|
+
"@sleepinsummer/agent-browser-cli-darwin-x64": "0.2.3",
|
|
26
|
+
"@sleepinsummer/agent-browser-cli-win32-x64": "0.2.3"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/sleepinginsummer/agent-browser-cli"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public",
|
|
37
|
+
"provenance": true
|
|
30
38
|
}
|
|
31
39
|
}
|