dsh-inner-browser-use 0.27.0 → 0.34.95

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
@@ -10,17 +10,22 @@ live picture of that browser, and your own cursor keeps working on the picture.
10
10
 
11
11
  | Tool | What it does |
12
12
  | --- | --- |
13
- | `sidecar_open` | Starts the browser (or reuses the running one) and opens an address. `headless: false` shows a real window on the desktop instead. |
14
- | `sidecar_view` | Returns the address, the title, every control as `1 … 120`, and the visible text. |
15
- | `sidecar_extract` | Returns the items a CSS selector matches, one compact line each with its link, instead of the whole page. |
16
- | `sidecar_click` | Clicks a numbered control, or an `x`/`y` point. `double: true` double-clicks. A cookie banner or modal over the control is cleared first, then the click happens. |
17
- | `sidecar_type` | Types text into the focused field, or clicks a numbered control first. Chinese goes in as one string. `submit: true` presses Enter. |
18
- | `sidecar_key` | Presses one key: Enter, Tab, Escape, Backspace, Delete, ArrowUp/Down, Home, End, PageUp, PageDown. |
19
- | `sidecar_scroll` | Scrolls the wheel at the centre of the page, or at `x`/`y`. `dy: 600` is about a screen down. |
20
- | `sidecar_shot` | Saves a full-size PNG into `~/.dsh-inner-browser-use/screenshots` and returns the path. |
21
- | `sidecar_state` | Reports whether the browser runs, which profile it uses, its address and title, and how many columns are showing it. |
22
-
23
- `sidecar_view` answers with one page of text:
13
+ | `browser_open` | Starts the browser (or reuses the running one) and opens an address. `headless: false` shows a real window on the desktop instead. |
14
+ | `browser_view` | Returns the address, the title, every control as `1 … 120`, and the visible text. |
15
+ | `browser_read` | Reads the page the way a person does: one Markdown block of headings, paragraphs, lists and links, no controls. Far fewer tokens than a snapshot on long pages, and the links stay usable. Give it a `query` and only the passages that answer it come back, ranked (BM25 over Readability-style blocks, link-heavy menus down-weighted). |
16
+ | `browser_find` | Finds words (or a regex) anywhere on the page: matching controls come back with a clickable number, matching text with its point, each saying whether it is on screen. |
17
+ | `browser_extract` | Returns the items a CSS selector matches, one compact line each with its link, instead of the whole page. |
18
+ | `browser_click` | Clicks a numbered control, or an `x`/`y` point. `double: true` double-clicks. A cookie banner or modal over the control is cleared first, then the click happens. |
19
+ | `browser_type` | Types text into the focused field, or clicks a numbered control first. Chinese goes in as one string. `submit: true` presses Enter. |
20
+ | `browser_key` | Presses one key: Enter, Tab, Escape, Backspace, Delete, Insert, arrows, Home, End, PageUp, PageDown, F1-F12, the numeric keypad, letters, digits, punctuation and every shifted symbol, plus ContextMenu, CapsLock, PrintScreen and media keys. `Ctrl`/`Alt`/`Shift`/`Meta`/`Mod` modifiers, chords with `+`, and `Ctrl+C/X/V/A/Z/Y` run the real editing commands. |
21
+ | `browser_scroll` | Scrolls the wheel at the centre of the page, or at `x`/`y`. `dy: 600` is about a screen down. |
22
+ | `browser_shot` | Saves a full-size PNG into `~/.dsh-inner-browser-use/screenshots` and returns the path. |
23
+ | `browser_state` | Reports whether the browser runs, which profile it uses, its address and title, and how many columns are showing it. |
24
+
25
+ `browser_read` on the same page is the words only, in Markdown (measured: 4,520
26
+ characters of an about page against 2,987 characters of snapshot — and the
27
+ snapshot spends most of its budget on controls; on a long article the gap grows
28
+ with the number of controls skipped). `browser_view` answers with one page of text:
24
29
 
25
30
  ```
26
31
  https://example.com
@@ -34,8 +39,9 @@ Numbers stay valid until the next read. Anything that changes the page returns a
34
39
 
35
40
  ## The column
36
41
 
37
- The pane is a picture of the browser, sent as JPEG over the session's own stream: 1440×900,
38
- quality 72, every frame, about 82 KB and 25 per second on a page at rest.
42
+ The pane is a picture of the browser, sent as JPEG over the session's own stream: quality 72,
43
+ every frame, about 82 KB and 25 per second on a page at rest. The page is laid out at the size
44
+ of the column, so the picture fills the frame instead of sitting letterboxed inside it.
39
45
 
40
46
  Two pointers live on that picture:
41
47
 
@@ -82,7 +88,9 @@ Screenshots are the only thing written outside the profile:
82
88
  | Read, dense page | 444 tokens (1510 chars, 90 controls) |
83
89
  | Read round trip | 1–4 ms |
84
90
  | Click round trip | 2 ms |
85
- | Screenshot | 77 ms, 113 KB |
91
+ | Key round trip | 7 ms |
92
+ | Key to next frame | 15–18 ms |
93
+ | Screenshot | 75 ms, 115 KB |
86
94
 
87
95
  ## Install
88
96
 
@@ -102,6 +110,22 @@ dsh plugin install ./dsh-inner-browser-use-0.16.0.tgz
102
110
  The plugin appears under **Plugins** as *Background browser*. It needs Google Chrome or
103
111
  Chromium on the machine; see [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md).
104
112
 
113
+ ## When it opens
114
+
115
+ Only when the person asks for it by name: "in the browser", "on the web page",
116
+ "open this site", "click it for me". A link on its own is not a request.
117
+
118
+ - A public article, one link's text, docs, a GitHub repo or PR: read it with
119
+ `web_fetch` or Envoy. No browser, no Chrome process.
120
+ - If the page needs a login, is an empty shell to `web_fetch`, or needs a click,
121
+ say why and ask once instead of starting a browser on your own.
122
+ - Asked for, it starts without a question and never opens a second, external
123
+ Chrome. The picture stays in this chat's right column and stays open when the
124
+ work is done.
125
+
126
+ One browser is shared by every chat (see [Sharing](#sharing)), so opening one is
127
+ a tab, not a second Chrome.
128
+
105
129
  ## Use
106
130
 
107
131
  1. Open the chat you want the agent to browse for.
@@ -110,24 +134,35 @@ Chromium on the machine; see [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md).
110
134
  The first call starts the browser and puts its mirror in this chat's right column. Nothing
111
135
  opens before a call: a chat that never asked for a page keeps its column as it was.
112
136
 
137
+ ## Sharing
138
+
139
+ Every chat uses the same background Chrome: one process, one tab per chat, and
140
+ each tab's address saved so it can be closed and reopened cheaply. Past six
141
+ chats the oldest tab nobody is watching is closed (a watched tab — the one on
142
+ someone's screen — never is). Tabs an earlier plugin load left behind are closed
143
+ on first use: one profile used for weeks otherwise keeps a renderer per chat that
144
+ ever opened it. Nothing is launched per chat, and the browser itself is closed 15
145
+ minutes after the last mirror is detached.
146
+
113
147
  ## Frames, downloads, network
114
148
 
115
149
  - **Frames are read, including cross-site ones.** Controls inside an iframe are numbered like
116
150
  the page's own, whether Chrome shares the page's process or runs the frame apart; a click in
117
151
  either lands where the frame actually sits.
118
152
  - **A download lands on disk.** A click that saves a file writes it into the browser's own
119
- profile folder, and `sidecar_downloads` names it, its size and when it arrived.
120
- - **The network is visible.** `sidecar_network` lists what the page asked for, newest first,
153
+ profile folder, and `browser_downloads` names it, its size and when it arrived.
154
+ - **The network is visible.** `browser_network` lists what the page asked for, newest first,
121
155
  so a page that fills itself in from an address can be understood without a screenshot.
122
156
  - **An overlay does not eat the action.** A cookie banner over the button is cleared the way a
123
157
  person would clear it, then the click lands — in the same call, and in every step of a
124
- `sidecar_do` batch. Anything offering to delete, pay or sign out is reported instead.
158
+ `browser_do` batch. Anything offering to delete, pay or sign out is reported instead.
125
159
 
126
160
  ## What it does not do
127
161
 
128
162
  - **It does not touch your Chrome.** The browser runs from a separate profile with no
129
163
  connection to the window you are using.
130
- - **The viewport is fixed.** 1440×900, desktop layout, no resizing and no mobile emulation.
164
+ - **The layout viewport is the column, nothing more.** Desktop layout, no mobile emulation, no
165
+ touch emulation; a very narrow column is laid out narrow rather than zoomed out.
131
166
  - **One page at a time.** A link that opens a tab is followed — the mirror lands on the new
132
167
  page and the popup closes — so there is never a second page to choose between.
133
168
 
package/README.zh.md CHANGED
@@ -9,17 +9,21 @@ profile,不是产品自带的那个浏览页签:右栏放的是它的画面
9
9
 
10
10
  | 工具 | 作用 |
11
11
  | --- | --- |
12
- | `sidecar_open` | 启动浏览器(已在跑就复用)并打开一个地址。传 `headless: false` 会改为在桌面上开真实窗口。 |
13
- | `sidecar_view` | 返回地址、标题、编号成 `1 … 120` 的控件,以及可见文字。 |
14
- | `sidecar_extract` | 按 CSS 选择器把列表项读成一行一条、带链接,比整页读省得多。 |
15
- | `sidecar_click` | 点编号控件,或点 `x`/`y` 坐标。`double: true` 双击。控件被横幅或弹层挡着时,先关掉它再点。 |
16
- | `sidecar_type` | 往焦点输入框输入文字,也可以先点一个编号控件。中文整段送进去。`submit: true` 回车提交。 |
17
- | `sidecar_key` | 按一个键:Enter、Tab、Escape、Backspace、Delete、上下左右、Home、End、PageUp、PageDown。 |
18
- | `sidecar_scroll` | 在页面中心滚轮,也可以指定 `x`/`y`。`dy: 600` 约一屏。 |
19
- | `sidecar_shot` | 存一张原尺寸 PNG 到 `~/.dsh-inner-browser-use/screenshots`,返回路径。 |
20
- | `sidecar_state` | 报浏览器在不在跑、用的哪个 profile、地址、标题,以及有几个右栏在看它。 |
21
-
22
- `sidecar_view` 一次给一页文本:
12
+ | `browser_open` | 启动浏览器(已在跑就复用)并打开一个地址。传 `headless: false` 会改为在桌面上开真实窗口。 |
13
+ | `browser_view` | 返回地址、标题、编号成 `1 … 120` 的控件,以及可见文字。 |
14
+ | `browser_read` | 按人读文章的方式给 Markdown(标题、段落、列表、链接)。带 `query` 只回能回答的段落;问不到时自动改为整页,不再空手回来。页面和上次读的没变就只回一行,不重发正文(`force: true` 强制重发)。 |
15
+ | `browser_extract` | 按 CSS 选择器把列表项读成一行一条、带链接,比整页读省得多。 |
16
+ | `browser_view` 的 `map` | 大页面先看地标:各类控件各多少个、去重后的控件和编号、正文多少字,但不带回正文。 |
17
+ | `browser_click` | 点编号控件,或点 `x`/`y` 坐标。`double: true` 双击。控件被横幅或弹层挡着时,先关掉它再点。 |
18
+ | `browser_type` | 往焦点输入框输入文字,也可以先点一个编号控件。中文整段送进去。`submit: true` 回车提交。 |
19
+ | `browser_key` | 按一个键:Enter、Tab、Escape、Backspace、Delete、上下左右、Home、End、PageUp、PageDown。 |
20
+ | `browser_scroll` | 在页面中心滚轮,也可以指定 `x`/`y`。`dy: 600` 约一屏。 |
21
+ | `browser_shot` | 存一张原尺寸 PNG 到 `~/.dsh-inner-browser-use/screenshots`,返回路径。 |
22
+ | `browser_state` | 报浏览器在不在跑、用的哪个 profile、地址、标题,以及有几个右栏在看它。 |
23
+
24
+ 点、输入、按键之后的那一行会多一句结果:`· navigated to …`(换页了)、`· content changed`(页内有变化)、`· no visible change`(点了没动)、Flash 页则是 `· screen updated` / `· no frame change`;`read: true` 时不再多说。
25
+
26
+ `browser_view` 一次给一页文本:
23
27
 
24
28
  ```
25
29
  https://example.com
@@ -72,6 +76,7 @@ profile 之外只写一样东西:`~/.dsh-inner-browser-use/screenshots/` 里
72
76
  | 单帧 | 1440×900 JPEG,约 82 KB |
73
77
  | 画面 | 约 25 帧每秒 |
74
78
  | 指针移动到箭头跟上 | 0.8–7 ms |
79
+ | 右栏里手动点击到画面更新 | 中位 13 ms,最坏 17 ms(点击派发 2 ms、悬停 8 ms) |
75
80
 
76
81
  ## 安装
77
82
 
@@ -98,12 +103,19 @@ dsh plugin install ./dsh-inner-browser-use-0.12.1.tgz
98
103
  第一次调用会启动浏览器,并把镜像放进这个会话的右栏。没有调用就不会有东西自己打开:没要过
99
104
  页面的会话,右栏保持原样。
100
105
 
106
+ ## Flash 页面
107
+
108
+ `browser_open` 带 `flash: true` 时,这个地址改用插件自带的 Flash 运行时(Electron 87 + Pepper Flash)在**离屏窗口**里播放:窗口一次都不显示,Dock 与菜单栏都不出现,画面只在发起会话的右栏里。切换回来再调一次 `flash: false`,选择会记住。运行时首次使用时下载到 `~/.dsh/inner-browser-use/flash/`,不需要单独安装播放器。
109
+
110
+ `npm run flash-hidden` 会真起一次运行时并断言「窗口未显示 / 帧持续产出 / 两帧不同」;`npm run flash-mirror` 量镜像帧率与按下/抬起/按键耗时;`npm run flash-tools` 量工具层成本(奥拉星登录页实测:点击 28 ms、输入 14 ms、`browser_view` 31 ms;同一页后续回话只说标题,点击 22 字符、输入 13 字符);`npm run flash-local` 用仓库自带的 SWF 在本机起页,不依赖网络,量首帧与输入直达。
111
+
101
112
  ## 框架、下载、网络
102
113
 
103
114
  - **iframe 能读,跨站也能。** 不管是和页面共用进程,还是 Chrome 单独给一个进程,里面的控件都和页面自己的控件一样有编号;点击按框架在页面上的实际位置落点。
104
- - **下载会落到磁盘。** 点一下就下载的文件写在这个浏览器自己的 profile 目录里,`sidecar_downloads` 报出文件名、大小和到达时间。
105
- - **能看到网络。** `sidecar_network` 倒序列出页面请求了什么,自己用接口填内容、屏幕上又看不出原因的页面,不用截图去猜。
106
- - **遮罩不吞动作。** 盖在按钮上的 cookie 横幅会按人的做法先关掉再点下去,同一次调用里完成;`sidecar_do` 的每一步都一样。写着删除、支付、退出的遮罩只报告,不代按。
115
+ - **下载会落到磁盘。** 点一下就下载的文件写在这个浏览器自己的 profile 目录里,`browser_downloads` 报出文件名、大小和到达时间。
116
+ - **PDF 有去处。** Chrome 无头进程画不出 PDF,右栏只会是白图;读到 PDF 时把文件取回归档到该浏览器 profile 的 `downloads/`,结果里直接给绝对路径,交给 `envoy_read` 或本地阅读器。
117
+ - **能看到网络。** `browser_network` 倒序列出页面请求了什么,自己用接口填内容、屏幕上又看不出原因的页面,不用截图去猜。
118
+ - **遮罩不吞动作。** 盖在按钮上的 cookie 横幅会按人的做法先关掉再点下去,同一次调用里完成;`browser_do` 的每一步都一样。写着删除、支付、退出的遮罩只报告,不代按。
107
119
 
108
120
  ## 不做什么
109
121