dsh-inner-browser-use 0.0.0-stage → 0.13.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 regrevia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,153 @@
1
- # Temporary Holding Version
1
+ # dsh-inner-browser-use
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A Chrome that the agent owns, mirrored into the right column of DeepSeek Harness.
4
+
5
+ The agent opens pages, reads them, clicks, types and scrolls. The browser is a separate
6
+ Chrome with its own profile on disk, not the tab the product ships: the column shows a
7
+ live picture of that browser, and your own cursor keeps working on the picture.
8
+
9
+ ## Tools
10
+
11
+ | Tool | What it does |
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_click` | Clicks a numbered control, or an `x`/`y` point. `double: true` double-clicks. |
16
+ | `sidecar_type` | Types text into the focused field, or clicks a numbered control first. Chinese goes in as one string. `submit: true` presses Enter. |
17
+ | `sidecar_key` | Presses one key: Enter, Tab, Escape, Backspace, Delete, ArrowUp/Down, Home, End, PageUp, PageDown. |
18
+ | `sidecar_scroll` | Scrolls the wheel at the centre of the page, or at `x`/`y`. `dy: 600` is about a screen down. |
19
+ | `sidecar_shot` | Saves a full-size PNG into `~/.dsh-inner-browser-use/screenshots` and returns the path. |
20
+ | `sidecar_state` | Reports whether the browser runs, which profile it uses, its address and title, and how many columns are showing it. |
21
+
22
+ `sidecar_view` answers with one page of text:
23
+
24
+ ```
25
+ https://example.com
26
+ Example Domain
27
+
28
+ 1 [a] More information
29
+ 7 [input] Search
30
+ ```
31
+
32
+ Numbers stay valid until the next read. Anything that changes the page returns a fresh read.
33
+
34
+ ## The column
35
+
36
+ The pane is a picture of the browser, sent as JPEG over the session's own stream: 1440×900,
37
+ quality 72, every frame, about 82 KB and 25 per second on a page at rest.
38
+
39
+ Two pointers live on that picture:
40
+
41
+ - **The black arrow** is the agent. It marks where its last click landed, and it moves the
42
+ moment a new one is dispatched, without waiting for the page to repaint.
43
+ - **Your cursor** is the real one. Hovering, clicking, the wheel and keystrokes are sent to
44
+ the browser as real mouse and keyboard input, so a site that rejects scripted clicks still
45
+ works. Moving your mouse never moves the black arrow.
46
+
47
+ The address row above the picture is an address bar: type an address and press Enter, or use
48
+ back, forward and reload. The field follows the page except while you are editing it.
49
+
50
+ Typing arrives two ways: composed text (Chinese, emoji, anything the input method produces)
51
+ lands as one insertion, and keys arrive as themselves, so Backspace deletes one character on
52
+ the page.
53
+
54
+ The pane opens only in the session that asked for it. A tool call in another session drives
55
+ the same browser without taking the column that someone else is reading.
56
+
57
+ ## Logins
58
+
59
+ The profile is a directory of its own: `~/.dsh/inner-browser-use/chrome/default`. It sits
60
+ outside the product's browser storage, which is created per process and gone on restart, so a
61
+ sign-in here is still there the next day.
62
+
63
+ - **Plugin reload.** A reload adopts the Chrome that is still running, with the page it was on.
64
+ - **Harness restart.** The same directory is opened again, so cookies, `localStorage` and
65
+ passwords that Chrome saved all survive.
66
+ - **Shutdown.** The browser is asked to close rather than killed, which is when Chrome writes
67
+ the last of its cookies; an idle browser is closed after 15 minutes, and the clock stops
68
+ while a column is watching.
69
+
70
+ Screenshots are the only thing written outside the profile:
71
+ `~/.dsh-inner-browser-use/screenshots/`.
72
+
73
+ ## Measured
74
+
75
+ | | |
76
+ | --- | --- |
77
+ | Navigate to first frame | ~850 ms, network included |
78
+ | Frame | 1440×900 JPEG, ~82 KB |
79
+ | Stream | ~25 frames per second |
80
+ | Pointer move to arrow | 0.8–7 ms |
81
+ | Read, dense page | 444 tokens (1510 chars, 90 controls) |
82
+ | Read round trip | 1–4 ms |
83
+ | Click round trip | 2 ms |
84
+ | Screenshot | 77 ms, 113 KB |
85
+
86
+ ## Install
87
+
88
+ ```bash
89
+ git clone https://github.com/regrevia/dsh-inner-browser-use
90
+ dsh plugin install /path/to/dsh-inner-browser-use
91
+ ```
92
+
93
+ In the app: **Plugins → Install from folder**, and pick the clone. To install the packed
94
+ tarball instead, build it from that directory and install the file:
95
+
96
+ ```bash
97
+ npm pack # writes dsh-inner-browser-use-0.13.0.tgz
98
+ dsh plugin install ./dsh-inner-browser-use-0.13.0.tgz
99
+ ```
100
+
101
+ The plugin appears under **Plugins** as *Background browser*. It needs Google Chrome or
102
+ Chromium on the machine; see [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md).
103
+
104
+ ## Use
105
+
106
+ 1. Open the chat you want the agent to browse for.
107
+ 2. Ask for something on a page: *"open example.com and tell me the title"*.
108
+
109
+ The first call starts the browser and puts its mirror in this chat's right column. Nothing
110
+ opens before a call: a chat that never asked for a page keeps its column as it was.
111
+
112
+ ## Frames, downloads, network
113
+
114
+ - **Frames are read, including cross-site ones.** Controls inside an iframe are numbered like
115
+ the page's own, whether Chrome shares the page's process or runs the frame apart; a click in
116
+ either lands where the frame actually sits.
117
+ - **A download lands on disk.** A click that saves a file writes it into the browser's own
118
+ profile folder, and `sidecar_downloads` names it, its size and when it arrived.
119
+ - **The network is visible.** `sidecar_network` lists what the page asked for, newest first,
120
+ so a page that fills itself in from an address can be understood without a screenshot.
121
+
122
+ ## What it does not do
123
+
124
+ - **It does not touch your Chrome.** The browser runs from a separate profile with no
125
+ connection to the window you are using.
126
+ - **The viewport is fixed.** 1440×900, desktop layout, no resizing and no mobile emulation.
127
+ - **One page at a time.** A link that opens a tab is followed — the mirror lands on the new
128
+ page and the popup closes — so there is never a second page to choose between.
129
+
130
+ ## Compatibility
131
+
132
+ | | |
133
+ | --- | --- |
134
+ | Harness | 0.2.0 or newer |
135
+ | Chrome | Google Chrome, Chromium or Canary, 112 or newer |
136
+ | Runtime | Node 20 or newer |
137
+ | License | MIT |
138
+
139
+ Details in [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md); how the halves connect in
140
+ [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
141
+
142
+ ## Development
143
+
144
+ ```bash
145
+ node --test test/*.test.mjs
146
+ ```
147
+
148
+ The server half is zero-dependency ESM, the page half is a client module loaded at runtime.
149
+ Neither has a build step.
150
+
151
+ ## License
152
+
153
+ MIT © regrevia
package/README.zh.md ADDED
@@ -0,0 +1,134 @@
1
+ # dsh-inner-browser-use
2
+
3
+ 一个由 agent 自己养的 Chrome,实时投到 DeepSeek Harness 的右栏里。
4
+
5
+ agent 打开网页、读页面、点、输入、滚动。这个浏览器是独立的 Chrome 进程,用自己的磁盘
6
+ profile,不是产品自带的那个浏览页签:右栏放的是它的画面,而画面上的鼠标仍然是你自己的。
7
+
8
+ ## 工具
9
+
10
+ | 工具 | 作用 |
11
+ | --- | --- |
12
+ | `sidecar_open` | 启动浏览器(已在跑就复用)并打开一个地址。传 `headless: false` 会改为在桌面上开真实窗口。 |
13
+ | `sidecar_view` | 返回地址、标题、编号成 `1 … 120` 的控件,以及可见文字。 |
14
+ | `sidecar_click` | 点编号控件,或点 `x`/`y` 坐标。`double: true` 双击。 |
15
+ | `sidecar_type` | 往焦点输入框输入文字,也可以先点一个编号控件。中文整段送进去。`submit: true` 回车提交。 |
16
+ | `sidecar_key` | 按一个键:Enter、Tab、Escape、Backspace、Delete、上下左右、Home、End、PageUp、PageDown。 |
17
+ | `sidecar_scroll` | 在页面中心滚轮,也可以指定 `x`/`y`。`dy: 600` 约一屏。 |
18
+ | `sidecar_shot` | 存一张原尺寸 PNG 到 `~/.dsh-inner-browser-use/screenshots`,返回路径。 |
19
+ | `sidecar_state` | 报浏览器在不在跑、用的哪个 profile、地址、标题,以及有几个右栏在看它。 |
20
+
21
+ `sidecar_view` 一次给一页文本:
22
+
23
+ ```
24
+ https://example.com
25
+ Example Domain
26
+
27
+ 1 [a] More information
28
+ 7 [input] Search
29
+ ```
30
+
31
+ 编号到下一次读之前都有效。任何改动页面的操作都会顺带返回一次新的读取。
32
+
33
+ ## 右栏
34
+
35
+ 那一栏显示的是浏览器的画面,按会话自己的流发 JPEG:1440×900,质量 72,每帧都发;静止
36
+ 页面上约 82 KB 一帧、每秒 25 帧。
37
+
38
+ 画面上有两个指针:
39
+
40
+ - **黑色箭头是 agent。** 它标在 agent 上一次点击的落点上,新的点击一发出箭头就动,不等
41
+ 页面重绘。
42
+ - **鼠标是你自己的。** 悬停、点击、滚轮、按键都当作真实输入交给浏览器,所以对拦截脚本点击
43
+ 的站也照常管用。移动鼠标不会带动黑色箭头。
44
+
45
+ 画面上方那行地址就是地址栏:输入域名回车,页面换成它;旁边是后退、前进、刷新。你在编辑时
46
+ 它不会跟着页面跳。
47
+
48
+ 输入分两路进来:输入法合成的文字(中文、emoji 等)整段插入,按键则按原样送过去,所以
49
+ Backspace 在页面上删掉的是一个字。
50
+
51
+ 右栏只在向它要过页面的那个会话里打开。别的会话调用工具时用的是同一个浏览器,但不会抢走
52
+ 别人正在看的这一栏。
53
+
54
+ ## 登录态
55
+
56
+ profile 是独立目录:`~/.dsh/inner-browser-use/chrome/default`。它在产品自己的浏览数据之外
57
+ ——那份数据是每个进程临时建的,进程一退就没了,所以在这里登过的账号第二天还在。
58
+
59
+ - **插件重载。** 重载会接上仍在运行的那个 Chrome,页面也还在原处。
60
+ - **Harness 重启。** 重新打开同一个目录,cookie、`localStorage` 和 Chrome 存下的密码都留着。
61
+ - **退出。** 关浏览器是请它自己关(`Browser.close`),Chrome 在这一步才把 cookie 落盘;空闲
62
+ 15 分钟会关掉,有右栏在看时不计这段空闲。
63
+
64
+ profile 之外只写一样东西:`~/.dsh-inner-browser-use/screenshots/` 里的截图。
65
+
66
+ ## 实测
67
+
68
+ | | |
69
+ | --- | --- |
70
+ | 打开页面到第一帧 | 约 850 ms,含网络加载 |
71
+ | 单帧 | 1440×900 JPEG,约 82 KB |
72
+ | 画面 | 约 25 帧每秒 |
73
+ | 指针移动到箭头跟上 | 0.8–7 ms |
74
+
75
+ ## 安装
76
+
77
+ ```bash
78
+ git clone https://github.com/regrevia/dsh-inner-browser-use
79
+ dsh plugin install /path/to/dsh-inner-browser-use
80
+ ```
81
+
82
+ 在应用里走 **插件 → 从文件夹安装**,选这个仓库目录。要装打包好的 tgz,就在该目录里打一个再装:
83
+
84
+ ```bash
85
+ npm pack # 得到 dsh-inner-browser-use-0.12.1.tgz
86
+ dsh plugin install ./dsh-inner-browser-use-0.12.1.tgz
87
+ ```
88
+
89
+ 装好后在 **插件** 里显示为 *后台浏览器*。机器上要有 Google Chrome 或 Chromium,细节见
90
+ [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md)。
91
+
92
+ ## 使用
93
+
94
+ 1. 打开你想让 agent 代跑的会话。
95
+ 2. 直接说要页面上的什么事:*「打开 example.com,告诉我标题」*。
96
+
97
+ 第一次调用会启动浏览器,并把镜像放进这个会话的右栏。没有调用就不会有东西自己打开:没要过
98
+ 页面的会话,右栏保持原样。
99
+
100
+ ## 框架、下载、网络
101
+
102
+ - **iframe 能读,跨站也能。** 不管是和页面共用进程,还是 Chrome 单独给一个进程,里面的控件都和页面自己的控件一样有编号;点击按框架在页面上的实际位置落点。
103
+ - **下载会落到磁盘。** 点一下就下载的文件写在这个浏览器自己的 profile 目录里,`sidecar_downloads` 报出文件名、大小和到达时间。
104
+ - **能看到网络。** `sidecar_network` 倒序列出页面请求了什么,自己用接口填内容、屏幕上又看不出原因的页面,不用截图去猜。
105
+
106
+ ## 不做什么
107
+
108
+ - **不动你自己的 Chrome。** 浏览器跑在单独的 profile 上,和你正在用的窗口没有关系。
109
+ - **视口固定。** 1440×900、桌面布局,不缩放,也不模拟手机。
110
+ - **一次一页。** 点开新页签的链接会被跟过去:镜像落到新页面,弹窗随即关掉,不会留下第二个页面要选。
111
+
112
+ ## 兼容性
113
+
114
+ | | |
115
+ | --- | --- |
116
+ | Harness | 0.2.0 及以上 |
117
+ | Chrome | Google Chrome、Chromium 或 Canary,112 及以上 |
118
+ | 运行时 | Node 20 及以上 |
119
+ | 许可 | MIT |
120
+
121
+ 细节在 [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md),两半怎么连起来在
122
+ [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)。
123
+
124
+ ## 开发
125
+
126
+ ```bash
127
+ node --test test/*.test.mjs
128
+ ```
129
+
130
+ 服务端那一半是零依赖 ESM,页面那一半是运行时加载的客户端模块,都不需要构建。
131
+
132
+ ## 许可
133
+
134
+ MIT © regrevia