dsh-rig 0.0.0 → 0.1.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+
3
+ 本项目的所有重要改动都会记在这里。格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
4
+ 版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。
5
+
6
+ ## [0.1.1] - 2026-11-21
7
+
8
+ ### Fixed
9
+
10
+ - 面板内嵌视图在实验室重启后卡在 `dsh web authentication required`:iframe 现在指向宿主的稳定入口
11
+ (每次 302 到实验室当前地址),不再持有会过期的端口与 token
12
+ - 实验室换地址时主动重导航一次内嵌视图(此前只更新状态、不触发重新加载)
13
+ - 事件流安静挂住时面板停在旧状态:新增 25 秒无事件即主动拉一次状态的看门狗
14
+
15
+ ## [0.1.0] - 2026-11-21
16
+
17
+ 第一个可用版本。
18
+
19
+ ### Added
20
+
21
+ - 右栏「插件实验室」面板:创建 / 启动 / 重启 / 刷新 / 弹出 / 停止 / 销毁一个**真实、进程级隔离**的 DSH
22
+ - 内嵌实时界面,配「锁定 / 可介入」开关(锁定只挡输入,不是安全边界)
23
+ - 实时日志:跟随实验室的 stdout/stderr,token 与用户名自动打码
24
+ - 体检报告 `report`:profile 声明 / 组合补丁行 / 运行时 / 启动期被禁用或加载失败的插件行 / 工作区文件树
25
+ - 智能体工具 `plugin_lab`(生命周期,常驻)
26
+ - 智能体工具 `lab_ui`(看 / 拍 / 按文字点 / 打字 / 派任务),**只在用户授权期间注册**
27
+ - 界面驱动后端按可用性降级:Playwright(自带或系统浏览器 channel)→ 裸 CDP → 明确报告缺失项
28
+ - 切换实验室使用的 DSH 版本(仅已安装版本),重启后生效
29
+ - 中英双语 README、插件详情页与预览图
30
+
31
+ ### Notes
32
+
33
+ - 实验室的 `DSH_HOME` 与宿主互不包含;创建与启动前都会校验,命中越界直接拒绝。
34
+ - 默认把宿主凭据复制进实验室,否则实验室里的智能体没有可用模型;可在配置里关闭。
35
+ - 已知边界:不能安装新的 DSH 版本;「向实验室派活」与施工可视化留待后续版本。
package/NOTICE ADDED
@@ -0,0 +1,18 @@
1
+ dsh-rig
2
+ Copyright 2026 gezi-wen
3
+
4
+ This product includes software developed as part of DeepSeek Harness plugin
5
+ development. It bundles no third-party runtime dependencies.
6
+
7
+ Design notes
8
+ ------------
9
+
10
+ The planned "agents at work" visualisation (a later release) takes its *idea*
11
+ from Swarm by Joel Califa and the Swarm Cursors extension by Dhvanil Patel.
12
+ Neither project is licensed for reuse, and no code, SVG paths, colour tables or
13
+ other assets from them are included here. Any animation shipped by this package
14
+ is an independent implementation of the concept.
15
+
16
+ "DeepSeek", "DeepSeek Harness" and the DeepSeek Harness marks are trademarks of
17
+ their respective owners. This package is an independent plugin and is not
18
+ published by DeepSeek.
package/README.en.md ADDED
@@ -0,0 +1,100 @@
1
+ # dsh-rig
2
+
3
+ A **right-sidebar plugin lab** for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): run a real, process-isolated DSH beside your conversation — install plugins into it, watch its logs, switch versions, and know that a crash stays inside the lab.
4
+
5
+ [中文](README.md) · [Changelog](CHANGELOG.md)
6
+
7
+ ![The plugin lab in the right sidebar, with a real DSH running inside](docs/screenshot-panel.png)
8
+
9
+ ## Why
10
+
11
+ When you develop a DSH plugin, the painful part is that **there is nowhere safe to break things**. The convenient move is to mount the plugin into the profile you are actually using — and one bad `apply()` takes the whole harness down with it.
12
+
13
+ dsh-rig gives you a test bench:
14
+
15
+ - the lab is **another process**, with its own `DSH_HOME`, profile, port and workspace;
16
+ - if it crashes, or its dependency tree gets mangled, it stays there (the host's dependency closure was measured unchanged);
17
+ - the panel lives in the right sidebar: state, logs, restart and a health report in one place.
18
+
19
+ ![The bundle's detail page](docs/screenshot-detail.png)
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ dsh plugin --profile web add dsh-rig
25
+ ```
26
+
27
+ Or from the app: **Plugins → Add plugin → dsh-rig**.
28
+
29
+ Reload the page afterwards: the session header gains a "Plugin Lab" button, and the right sidebar's start page gains a card.
30
+
31
+ ## Use
32
+
33
+ 1. Open the **Plugin Lab** tab → **Create lab**;
34
+ 2. **Start** — a real DSH comes up in about ten seconds, embedded right there;
35
+ 3. **Locked / Step in** — locking blocks only your mouse and keyboard (anti-mistouch); unlock and click away;
36
+ 4. **Restart / Refresh / Pop out / Stop / Destroy** — the whole lifecycle in one row;
37
+ 5. **Logs** — follows its stdout/stderr, with tokens and user names redacted.
38
+
39
+ Labs live under the application data directory (`%LOCALAPPDATA%\dsh-rig` on Windows), one folder per lab with `home/` (DSH_HOME), `workspace/` and `shots/`.
40
+
41
+ ## How isolated is it
42
+
43
+ | Layer | Covered | Not covered |
44
+ |---|---|---|
45
+ | Process | separate process, crash containment, own port | — |
46
+ | DSH data | own `DSH_HOME` (credentials, sessions, profile, plugins) | — |
47
+ | Filesystem | `workspace-write` by default, cwd pinned to the lab workspace | does not stop the lab's agent from touching files its permission allows |
48
+ | Kernel | — | Home-edition Windows has no Sandbox/Hyper-V, so this is not VM-level isolation |
49
+ | Input | lock blocks mouse and keyboard | does not block the lab's own agent; this is not a security boundary |
50
+
51
+ ## Agent tools
52
+
53
+ Two tools are added:
54
+
55
+ | Tool | Available | Does |
56
+ |---|---|---|
57
+ | `plugin_lab` | always | `list / create / start / stop / restart / destroy / status / logs / report / versions / set_version` |
58
+ | `lab_ui` | **only while you allow it** | `snapshot / screenshot / click / type / task` — finds buttons **by their text** and lists candidates when it cannot |
59
+
60
+ `lab_ui` is not resident: a tool schema costs context every turn, and most sessions never click anything. So it sits behind a permission — the panel's "Let the agent operate the UI" switch registers it, and turning the switch off unregisters it.
61
+
62
+ The UI backend degrades by availability, and **assumes no browser**:
63
+
64
+ 1. Playwright with its own browser;
65
+ 2. Playwright driving the system Edge/Chrome (no download);
66
+ 3. Raw CDP against any installed Chromium-based browser (zero npm dependencies);
67
+ 4. Otherwise it says exactly what is missing.
68
+
69
+ ## Health report (`report`)
70
+
71
+ Being able to *see* is worth more than being able to *click*. `report` returns blocks, each with its own evidence source:
72
+
73
+ - **declared** — bundles the profile declares;
74
+ - **patched** — rows in the composition patch;
75
+ - **runtime** — status, port, exit code;
76
+ - **logFacts** — plugin rows denied or failed at startup;
77
+ - **workspace** — workspace file tree.
78
+
79
+ Anything unreadable is reported as unreadable with a reason — never an empty array pretending to be "none".
80
+
81
+ ## Configuration
82
+
83
+ | Field | Default | Meaning |
84
+ |---|---|---|
85
+ | `labRoot` | `dsh-rig` under app data | Lab root; **must not contain or sit inside the host `DSH_HOME`**, otherwise creation is refused |
86
+ | `copyCredentials` | `true` | Copy the host `.credentials.yaml` into the lab (without it the lab's agent has no model) |
87
+ | `maxLabs` | `8` | Concurrent labs |
88
+ | `startTimeoutMs` | `60000` | How long to wait for HTTP readiness |
89
+ | `logRingLines` | `2000` | Log lines kept per lab |
90
+ | `uiBackend` | `auto` | `auto / playwright / cdp`; also `DSH_RIG_UI_BACKEND` |
91
+
92
+ ## Known limits
93
+
94
+ - Switching DSH versions works only for **already installed** versions (no installer yet).
95
+ - "Dispatch a task into the lab" and progress visualisation are not built yet — for now you type in the unlocked view, or let the agent drive `lab_ui`.
96
+ - The headless browser opens a local debugging port. It lives only while the lab runs and only while you allow it, but that is the inherent cost of the simulate-a-human path.
97
+
98
+ ## License
99
+
100
+ Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
package/README.md CHANGED
@@ -1,22 +1,102 @@
1
1
  # dsh-rig
2
2
 
3
- **名称占位 / Name reservation.** 这个版本(`0.0.0`)不包含任何实现,也不声明 `dsh` bundle,装不上、也不该装。
3
+ 给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的**右栏插件实验室**:在会话旁边跑一个真实、进程级隔离的 DSH,装插件、看日志、换版本,崩了不牵连你正在用的这个。
4
4
 
5
- 正式版本从 **`0.1.0`** 开始。
5
+ [English](README.en.md) · [更新日志](CHANGELOG.md)
6
6
 
7
- ## 它要做成什么
7
+ ![右栏里的插件实验室:一个真实 DSH 正在运行](docs/screenshot-panel.png)
8
8
 
9
- 给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 加一个右栏「插件实验室」:
9
+ ## 它解决什么
10
10
 
11
- - 右栏里开一个**真实的、进程级隔离的 DSH 实例**(独立 `DSH_HOME`、独立 profile、独立端口、独立工作区)
12
- - 面板上能重启 / 刷新 / 换 DSH 版本 / 看实时日志
13
- - 一个「锁定 / 可介入」开关:锁定态旁观智能体干活,解锁态你自己上手点
14
- - 实验室整个崩掉,宿主端毫发无损
11
+ 开发 DSH 插件时,最难受的是**没有一块可以随便弄坏的地方**:图省事把插件挂进自己在用的 profile,一次坏的 `apply()` 就把整个 harness 拖下去。
15
12
 
16
- ## 为什么先占这个名字
13
+ dsh-rig 给你一块试验台:
17
14
 
18
- `dsh-plugin-lab`、`dsh-bay`、`dsh-range` 等相近名字已被占用,先把这个名字钉住,避免正式发布时被迫改名。
15
+ - 实验室是**另一个进程**,有自己的 `DSH_HOME`、profile、端口和工作区;
16
+ - 它崩了、它的依赖树乱了,都只发生在它自己身上(宿主依赖闭包实测零变化);
17
+ - 面板就在右栏,状态、日志、重启、体检都在一处。
19
18
 
20
- ## License
19
+ ![插件详情页](docs/screenshot-detail.png)
21
20
 
22
- Apache-2.0
21
+ ## 装
22
+
23
+ ```bash
24
+ dsh plugin --profile web add dsh-rig
25
+ ```
26
+
27
+ 或在 DSH 里:**插件 → 添加插件 → dsh-rig**。
28
+
29
+ 装完刷新页面,会话头部会多一个「插件实验室」按钮;右栏开始页也会多一张卡片。
30
+
31
+ ## 用
32
+
33
+ 1. 点右栏「插件实验室」→「创建实验室」;
34
+ 2. 「启动」:起一个真实 DSH(十秒左右到「运行中」),右栏里直接嵌着它的界面;
35
+ 3. 「锁定 / 可介入」:锁定只挡你的鼠标键盘(防误触),解锁就直接在里面点;
36
+ 4. 「重启 / 刷新 / 弹出 / 停止 / 销毁」:生命周期都在这一行;
37
+ 5. 「日志」:跟着它的 stdout/stderr,token 与用户名自动打码。
38
+
39
+ 实验室默认落在 `%LOCALAPPDATA%\dsh-rig\`(Windows 上;其它平台回落到应用数据目录),
40
+ 每个实验室一份 `home/`(DSH_HOME)、`workspace/`、`shots/`。
41
+
42
+ ## 隔离到什么程度
43
+
44
+ | 层 | 做到 | 没做到 |
45
+ |---|---|---|
46
+ | 进程 | 独立进程、崩溃不连坐、独立端口 | — |
47
+ | DSH 数据 | 独立 `DSH_HOME`(凭据、会话、profile、依赖全隔离) | — |
48
+ | 文件系统 | 默认 `workspace-write`,cwd 锁在实验室工作区 | 不防实验室里的智能体按它的权限读写你机器别处 |
49
+ | 内核 | — | 家庭版 Windows 没有 Sandbox / Hyper-V,所以不是虚拟机级隔离 |
50
+ | 输入 | 锁定态挡鼠标键盘 | 挡不住实验室自己的智能体;这不是安全边界 |
51
+
52
+ ## 工具面
53
+
54
+ 装好后,智能体多两个工具:
55
+
56
+ | 工具 | 什么时候在 | 干什么 |
57
+ |---|---|---|
58
+ | `plugin_lab` | 常驻 | `list / create / start / stop / restart / destroy / status / logs / report / versions / set_version` |
59
+ | `lab_ui` | **只在你授权期间** | `snapshot / screenshot / click / type / task` —— 按**文字**找按钮,找不到会把候选名列出来 |
60
+
61
+ `lab_ui` 不是常驻的:工具 schema 每轮都进上下文,而大多数时候用不到「点按钮」。
62
+ 所以它挂在权限后面——面板里打开「智能体操作界面」才注册,关掉即注销。
63
+
64
+ 界面驱动的后端按可用性降级,**不假设你机器上有浏览器**:
65
+
66
+ 1. Playwright(自带浏览器);
67
+ 2. Playwright 借用系统 Edge/Chrome(不下载);
68
+ 3. 裸 CDP 直连系统 Chromium 系浏览器(零 npm 依赖);
69
+ 4. 都没有就明说缺什么。
70
+
71
+ ## 体检(`report`)
72
+
73
+ 比「能点」更值钱的是「看得清」。`report` 给出一份分块报告,每块有各自的证据来源:
74
+
75
+ - **declared**:profile 声明了哪些 bundle;
76
+ - **patched**:组合补丁里的行;
77
+ - **runtime**:状态、端口、退出码;
78
+ - **logFacts**:启动期被版本闸门禁用或加载失败的插件行;
79
+ - **workspace**:工作区文件树。
80
+
81
+ 读不到就写「读不到」加原因,不拿空数组冒充「没有」。
82
+
83
+ ## 配置
84
+
85
+ | 字段 | 默认 | 说明 |
86
+ |---|---|---|
87
+ | `labRoot` | 应用数据目录下的 `dsh-rig` | 实验室根目录;**必须与宿主 `DSH_HOME` 互不包含**,否则拒绝创建 |
88
+ | `copyCredentials` | `true` | 把宿主 `.credentials.yaml` 复制进实验室(否则实验室里的智能体没有可用模型) |
89
+ | `maxLabs` | `8` | 同时存在的实验室上限 |
90
+ | `startTimeoutMs` | `60000` | 等 HTTP 就绪的上限 |
91
+ | `logRingLines` | `2000` | 每个实验室保留的日志行数 |
92
+ | `uiBackend` | `auto` | `auto / playwright / cdp`;也可用环境变量 `DSH_RIG_UI_BACKEND` |
93
+
94
+ ## 已知边界
95
+
96
+ - 换 DSH 版本目前只能切到**已装**的版本(安装新版本的入口还没做)。
97
+ - 「派活给实验室里的智能体」与「施工过程可视化」还没做——现在靠你在解锁态下自己输入,或让智能体用 `lab_ui` 去点。
98
+ - 无头浏览器会开一个本地调试端口;它随实验室起停、只在授权期间存在,但这是「模拟点击」这条路的固有代价。
99
+
100
+ ## 许可
101
+
102
+ Apache-2.0,见 [LICENSE](LICENSE) 与 [NOTICE](NOTICE)。
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: dsh-rig
3
+ name: 'dsh-rig'
package/docs/DETAIL.md ADDED
@@ -0,0 +1 @@
1
+ ![A lab tab in the right sidebar showing a nested DSH instance that is running](preview.svg)
@@ -0,0 +1 @@
1
+ ![右栏的实验室页签里,嵌着一个正在运行的真实 DSH](preview.svg)
@@ -0,0 +1,40 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300">
2
+ <!-- 左:对话区(暗) -->
3
+ <rect width="640" height="300" rx="20" fill="#0f1115"/>
4
+ <rect x="40" y="36" width="300" height="228" rx="14" fill="#151922" stroke="#232a36" stroke-width="2"/>
5
+ <rect x="60" y="56" width="150" height="10" rx="5" fill="#2c3546"/>
6
+ <rect x="60" y="80" width="240" height="8" rx="4" fill="#1e2530"/>
7
+ <rect x="60" y="96" width="200" height="8" rx="4" fill="#1e2530"/>
8
+ <rect x="60" y="196" width="260" height="48" rx="12" fill="#11151d" stroke="#2c3546" stroke-width="2"/>
9
+ <rect x="76" y="214" width="120" height="8" rx="4" fill="#2c3546"/>
10
+
11
+ <!-- 右:实验室页签 -->
12
+ <rect x="356" y="36" width="244" height="228" rx="14" fill="#151922" stroke="#3f6ea8" stroke-width="2"/>
13
+ <rect x="372" y="50" width="86" height="16" rx="8" fill="#1c2532" stroke="#3f6ea8" stroke-width="1.5"/>
14
+ <circle cx="384" cy="58" r="4" fill="#37b26d"/>
15
+ <rect x="394" y="54" width="52" height="8" rx="4" fill="#33405a"/>
16
+
17
+ <!-- 状态行 + 控件行 -->
18
+ <rect x="372" y="76" width="120" height="10" rx="5" fill="#2c3546"/>
19
+ <circle cx="508" cy="81" r="5" fill="#37b26d"/>
20
+ <rect x="520" y="77" width="60" height="8" rx="4" fill="#243047"/>
21
+ <rect x="372" y="96" width="44" height="16" rx="8" fill="#1b2a3d" stroke="#3f6ea8" stroke-width="1.5"/>
22
+ <rect x="422" y="96" width="44" height="16" rx="8" fill="#1c2532"/>
23
+ <rect x="472" y="96" width="44" height="16" rx="8" fill="#1c2532"/>
24
+ <rect x="522" y="96" width="56" height="16" rx="8" fill="#1c2532"/>
25
+
26
+ <!-- 内嵌真实实例:窗口 + 左栏 + 输入框 -->
27
+ <rect x="372" y="120" width="212" height="98" rx="10" fill="#0d1016" stroke="#2c3546" stroke-width="2"/>
28
+ <rect x="382" y="130" width="46" height="78" rx="6" fill="#151a23"/>
29
+ <rect x="388" y="138" width="34" height="6" rx="3" fill="#2c3546"/>
30
+ <rect x="388" y="150" width="34" height="6" rx="3" fill="#232a36"/>
31
+ <rect x="388" y="162" width="34" height="6" rx="3" fill="#232a36"/>
32
+ <rect x="438" y="140" width="120" height="8" rx="4" fill="#232a36"/>
33
+ <rect x="438" y="156" width="96" height="8" rx="4" fill="#1e2530"/>
34
+ <rect x="438" y="184" width="134" height="22" rx="8" fill="#11151d" stroke="#2c3546" stroke-width="1.5"/>
35
+
36
+ <!-- 锁形徽标 -->
37
+ <circle cx="560" cy="234" r="12" fill="#1b2a3d" stroke="#3f6ea8" stroke-width="1.5"/>
38
+ <rect x="555" y="231" width="10" height="7" rx="2" fill="#3f6ea8"/>
39
+ <path d="M557 231v-3a3 3 0 0 1 6 0v3" stroke="#3f6ea8" stroke-width="1.6" fill="none"/>
40
+ </svg>
Binary file
Binary file
package/icon.svg ADDED
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="none">
2
+ <!-- 试验台:两根立柱 + 顶梁,罩住一块待测芯片 -->
3
+ <path d="M7 8h22" stroke="#247bbf" stroke-width="2.6" stroke-linecap="round"/>
4
+ <path d="M9.5 8v9M26.5 8v9" stroke="#247bbf" stroke-width="2.6" stroke-linecap="round"/>
5
+ <rect x="12" y="17" width="12" height="11" rx="2.4" stroke="#7fb2d9" stroke-width="2.2"/>
6
+ <path d="M15.5 17v-2.2M20.5 17v-2.2M18 28v2.2" stroke="#7fb2d9" stroke-width="2" stroke-linecap="round"/>
7
+ <circle cx="18" cy="22.5" r="2.1" fill="#247bbf"/>
8
+ </svg>