@linxin666/dsh-client-ui-browser-view 0.4.22 → 0.4.23
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.i18n.yaml +2 -2
- package/README.md +5 -3
- package/README.zh.md +5 -3
- package/lib/client.js +3 -3
- package/lib/client.js.map +1 -1
- package/lib/index.js +2254 -677
- package/lib/types/client/BrowserViewSettingsCard.d.ts +1 -1
- package/lib/types/client/config.d.ts +1 -1
- package/lib/types/client/guide-icon.d.ts +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/panel.d.ts +1 -1
- package/lib/types/client/tab-title.d.ts +1 -1
- package/lib/types/host/auth.d.ts +15 -0
- package/lib/types/host/service.d.ts +7 -6
- package/lib/types/index.d.ts +2 -3
- package/package.json +24 -24
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# node scripts/verify-docs.mjs --write <dir>
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 4e388224518366835c8ccf366d61c3543553655e
|
|
6
|
+
README.zh.md: 03d177270a15d11307ae96e1489743d2296395ff
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.3--alpha.
|
|
6
|
+
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.3--alpha.4-4c6ef5?style=flat-square&labelColor=454a54" alt="DSH">
|
|
7
7
|
|
|
8
8
|
<img src="https://img.shields.io/badge/license-BSD--3--Clause-blue?style=flat-square" alt="License">
|
|
9
9
|
</p>
|
|
@@ -19,7 +19,7 @@ This package is an external plugin for DeepSeek Harness (DSH), structured as a c
|
|
|
19
19
|
- **Evidence in the conversation**: every `browser_screenshot` result carries the image, so the transcript keeps the picture the agent acted on instead of only a sentence about it.
|
|
20
20
|
- **Isolated by default**: the plugin launches its own Chromium with a throwaway profile, so the browser you are signed into is not touched while the mode below stays off.
|
|
21
21
|
- **Your own browser on request**: with `realBrowserEnabled` set, the plugin attaches over CDP to a browser you started with remote debugging. Each DSH session on this host can enumerate, read, navigate, click and type in every tab that browser has — tabs that existed before the attach and tabs opened afterwards — and the sign-ins already in that profile work, because the pages run in it and no cookie is imported.
|
|
22
|
-
- **Signs itself in to this host's own GUI**: a fresh isolated profile has no session cookie, so the viewer would only ever see the 401 challenge. When a navigation lands on that challenge over loopback, the plugin asks the host's
|
|
22
|
+
- **Signs itself in to this host's own GUI**: a fresh isolated profile has no session cookie, so the viewer would only ever see the 401 challenge. When a navigation lands on that challenge over loopback, the plugin asks the host webserver's `webserver/entry-url` event for the same ticketed URL `dsh web` printed, and retries once. The challenge is the exchange page's own sentence, the bare `unauthorized` a Host answers when route admission refuses the site root first, or the "Connect to this Host" sign-in page (token form or device pairing) the official remote-connection plugin renders at the root; the last two only count when the requested URL is the root of this host's own listener origin (same protocol and port). The cookie that mints lives in the throwaway profile and dies with it.
|
|
23
23
|
- **Closing is explicit, and idle pages clean themselves up**: `browser_close` without a tab id closes only the tabs the calling session opened; a tab of an attached browser closes only when the call names its id. The panel shows no close control for such a tab. Separately, a page the plugin opened itself closes once no browser tool has touched it for `idleCloseDays` days, so a forgotten page does not outlive the session that opened it.
|
|
24
24
|
|
|
25
25
|
## How it works
|
|
@@ -90,7 +90,7 @@ Sign in to the sites the agent should see inside that profile once; the plugin d
|
|
|
90
90
|
- **Idle close never touches an adopted page**: the sweep selects only targets the plugin created itself, so a tab of your own browser closes only when a caller names its id, and disposing the plugin still closes nothing there.
|
|
91
91
|
- **Process lifetime**: a Chromium the plugin launched is killed when the plugin disposes; disposing or changing configuration only detaches from an external browser and closes neither the browser nor any of its tabs. A session whose CDP socket has closed is dropped on its next call and detached the same way — it never closes an external browser or its tabs — then reconnected to the configured endpoint; a reconnect that fails is reported as the connection error, and the configured source is never swapped for another one.
|
|
92
92
|
- **Failure is an error, not a downgrade**: an endpoint that does not answer fails the tool call with the connection error, and the plugin never falls back to the isolated browser, so the panel cannot show a browser other than the configured one.
|
|
93
|
-
- **Token handling**: the launch token is minted per navigation, held in memory, and never written to disk; the retry only happens on a loopback target whose document is DSH's own challenge, so no other local service is ever handed the token. A bare refusal is attributed to this host by its published listener origin before the token is minted.
|
|
93
|
+
- **Token handling**: the launch token is minted per navigation, held in memory, and never written to disk; the retry only happens on a loopback target whose document is DSH's own challenge, so no other local service is ever handed the token. A bare refusal or a sign-in page is attributed to this host by its published listener origin before the token is minted.
|
|
94
94
|
|
|
95
95
|
## Known limits
|
|
96
96
|
|
|
@@ -109,6 +109,8 @@ Sign in to the sites the agent should see inside that profile once; the plugin d
|
|
|
109
109
|
## Install
|
|
110
110
|
|
|
111
111
|
```sh
|
|
112
|
+
dsh plugin --profile web add @linxin666/dsh-client-ui-browser-view@latest
|
|
113
|
+
# or from a local checkout:
|
|
112
114
|
dsh plugin --profile web add link:<this repo>/packages/dsh-browser-view
|
|
113
115
|
```
|
|
114
116
|
|
package/README.zh.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.3--alpha.
|
|
6
|
+
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.3--alpha.4-4c6ef5?style=flat-square&labelColor=454a54" alt="DSH">
|
|
7
7
|
|
|
8
8
|
<img src="https://img.shields.io/badge/license-BSD--3--Clause-blue?style=flat-square" alt="License">
|
|
9
9
|
</p>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
- **证据留在对话里**:每次 `browser_screenshot` 的结果都带图,于是对话记录保留的是 agent 真正看到的那一屏,而不只是一句转述。
|
|
20
20
|
- **默认隔离**:插件自己拉起 Chromium,用一次性 profile;只要下面那个模式关着,它就不碰你已经登录的浏览器。
|
|
21
21
|
- **按需接管你自己的浏览器**:把 `realBrowserEnabled` 打开后,插件经 CDP 接管你用远程调试启动的浏览器。本机每个 DSH 会话都能枚举、读取、导航、点击与输入它现有的全部标签页,以及之后新开的标签页;那个 profile 里已有的登录态直接可用,因为页面就跑在里面,插件不导入任何 cookie。
|
|
22
|
-
- **能进这台机器自己的 GUI**:全新隔离 profile 没有会话 cookie,本来只会看到 401 提示页。当导航落在 loopback
|
|
22
|
+
- **能进这台机器自己的 GUI**:全新隔离 profile 没有会话 cookie,本来只会看到 401 提示页。当导航落在 loopback 上的那页提示时,插件经宿主 WebServer 的 `webserver/entry-url` 事件要一条与 `dsh web` 启动时打印的同样的带票 URL,补一次。提示页有三种:token 交换页自己的那句话、宿主在路由准入阶段拒绝站点根地址时返回的裸 `unauthorized`,以及官方 remote-connection 插件在根地址渲染的「连接到此 Host」登录页(令牌表单或设备配对);后两种只在请求 URL 就是本宿主自己的监听者(协议与端口一致)的根地址时才算数。种下的 cookie 只活在这个一次性 profile 里,随它一起销毁。
|
|
23
23
|
- **关闭是显式的,闲置页面由插件自己收尾**:不带 tab id 的 `browser_close` 只关调用它的会话自己打开的标签页;被接管浏览器的标签页,只有调用里点名它的 id 才会关。面板对这种标签页不提供关闭控件。另外,插件自己打开的页面在 `idleCloseDays` 天没有工具动作后自动关闭,被遗忘的页面不会比打开它的会话活得更久。
|
|
24
24
|
|
|
25
25
|
## 工作原理
|
|
@@ -90,7 +90,7 @@ agent 工具调用 ──► 宿主半区 ──► CDP ──► 它自己的 C
|
|
|
90
90
|
- **闲置关闭不碰接管的页面**:扫描只选插件自己创建的 target,所以你自己的浏览器标签页仍然只有调用点名 id 才会关,插件卸载时那边也依然什么都不关。
|
|
91
91
|
- **进程寿命**:插件自己拉起的 Chromium 在插件卸载时被杀掉;插件卸载或配置变更只从外部浏览器分离,不关闭浏览器,也不关闭它的任何标签页。CDP socket 已关闭的会话在下一次调用时被丢弃、按同样方式分离——绝不关闭外部浏览器或其标签页——再重新连接到所配置的端点;重连失败按连接错误上报,所配置的来源绝不会被换成另一个。
|
|
92
92
|
- **失败是报错,不是降级**:端点没有应答时工具调用以连接错误失败,插件绝不回退到隔离浏览器,因此面板不会显示出所配置之外的那个浏览器。
|
|
93
|
-
- **令牌处理**:启动令牌每次导航现取、只在内存里,从不落盘;补票只发生在 loopback 目标且文档确实是 DSH 自己的鉴权页时,因此令牌不会被交给别的本地服务。裸 `unauthorized`
|
|
93
|
+
- **令牌处理**:启动令牌每次导航现取、只在内存里,从不落盘;补票只发生在 loopback 目标且文档确实是 DSH 自己的鉴权页时,因此令牌不会被交给别的本地服务。裸 `unauthorized` 与登录页都先按宿主发布的监听者 origin 归因,确认是本机后才取票。
|
|
94
94
|
|
|
95
95
|
## 已知限制
|
|
96
96
|
|
|
@@ -109,6 +109,8 @@ agent 工具调用 ──► 宿主半区 ──► CDP ──► 它自己的 C
|
|
|
109
109
|
## 安装
|
|
110
110
|
|
|
111
111
|
```sh
|
|
112
|
+
dsh plugin --profile web add @linxin666/dsh-client-ui-browser-view@latest
|
|
113
|
+
# 或从本地仓库检出安装:
|
|
112
114
|
dsh plugin --profile web add link:<this repo>/packages/dsh-browser-view
|
|
113
115
|
```
|
|
114
116
|
|
package/lib/client.js
CHANGED
|
@@ -5,7 +5,7 @@ window.__ModuleLoader__.load({
|
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
7
|
let react = require("react");
|
|
8
|
-
let
|
|
8
|
+
let _deepseek_ai_dsh_client_ui_primitives_client = require("@deepseek-ai/dsh-client-ui-primitives/client");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
|
|
11
11
|
//#region src/client/live-title.ts
|
|
@@ -717,7 +717,7 @@ window.__ModuleLoader__.load({
|
|
|
717
717
|
"aria-live": "polite",
|
|
718
718
|
title: state.cdpEndpoint ?? modeLabel,
|
|
719
719
|
children: [
|
|
720
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
720
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives_client.StateDot, {
|
|
721
721
|
state: dotState,
|
|
722
722
|
size: 10
|
|
723
723
|
}),
|
|
@@ -747,7 +747,7 @@ window.__ModuleLoader__.load({
|
|
|
747
747
|
kind: "request-frame"
|
|
748
748
|
});
|
|
749
749
|
},
|
|
750
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
750
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives_client.IconRefreshOutlineRegular, {})
|
|
751
751
|
})
|
|
752
752
|
]
|
|
753
753
|
}),
|