@tunnelbox/dsh-tunnelbox 0.1.3 → 0.1.4
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 +128 -144
- package/README.zh-CN.md +128 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,144 +1,128 @@
|
|
|
1
|
-
# @tunnelbox/dsh-tunnelbox
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
|
78
|
-
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
profile
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
- **local(headless `tunnelbox` profile)**:注册**本地瀑布应答者**(手机唯一作答):手机在线且归属可路由 → 推送 `question.request`/`permission.request`,作答回填;离线 → `next()` 委托(headless 无其它应答者即按官方 fail/NO_PROVIDER)。
|
|
130
|
-
- 旧版 `registerProvider` 单 provider 槽位与 host-apiproxy `events.mux` 已在官方运行时移除,本插件不再使用。
|
|
131
|
-
- 升级 dsh 时注意把 `package.json` 的 `@deepseek-ai/*` peerDependencies 对齐到实际运行时版本(当前机器为 `0.1.2-rc.1`)。
|
|
132
|
-
|
|
133
|
-
## 多 agent 隔离
|
|
134
|
-
|
|
135
|
-
每个 `dsh --profile <name>` 是独立进程,天然隔离(不同 profile 可配不同 cwd/模型/工具集/审批策略)。同机跑多个:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
# 实例 A:工程目录 + workspace-write 审批
|
|
139
|
-
DSH_HOME=~/.dsh-a dsh --profile tunnelbox --patch ./a.patch.yml
|
|
140
|
-
# 实例 B:另一工程目录 + danger-full-access
|
|
141
|
-
DSH_HOME=~/.dsh-b DSH_PERMISSION_MODE=danger-full-access dsh --profile tunnelbox --patch ./b.patch.yml
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
手机端每个实例按 `type=dsh` + 独立 agentID(各自 `remote-state.dsh.json`)区分。
|
|
1
|
+
# @tunnelbox/dsh-tunnelbox
|
|
2
|
+
|
|
3
|
+
[English](README.md) · [简体中文](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
**Official website:** [www.tunnelbox.top](https://www.tunnelbox.top)
|
|
6
|
+
|
|
7
|
+
**tunnelbox DeepSeek Harness (dsh) plugin:** run dsh on your computer and drive it from your phone — agents, sessions, tools, approvals, abort. It runs **inside the dsh (Cordis) process** and dials **out** to a relay only (no public IP, no port forwarding).
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Phone app ──WSS──► relay ──WSS──► this plugin (inside dsh) ──ctx.agents/session/approval──► DeepSeek Harness
|
|
11
|
+
(dsh --profile tunnelbox)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick start (install → run → pair → use)
|
|
15
|
+
|
|
16
|
+
Follow these steps once on a computer that has DeepSeek Harness installed.
|
|
17
|
+
|
|
18
|
+
### Step 0 — Prepare your phone
|
|
19
|
+
|
|
20
|
+
Install the tunnelbox App (Android & iOS) from the official website: **https://www.tunnelbox.top**
|
|
21
|
+
|
|
22
|
+
- Sign in / create an account when prompted.
|
|
23
|
+
|
|
24
|
+
### Step 1 — Install the plugin into a dsh profile
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
dsh plugin --profile tunnelbox add @tunnelbox/dsh-tunnelbox
|
|
28
|
+
dsh --profile tunnelbox --dump-config # optional: confirm the tunnelbox-dsh bundle layer
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Step 2 — Run dsh with the profile
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
dsh --profile tunnelbox
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
dsh starts the harness plus this plugin, which connects to the relay and prints a **pairing QR code + pairing code** in the terminal. Credentials are read automatically from `$DSH_HOME/.credentials.yaml` (default `~/.dsh/`).
|
|
38
|
+
|
|
39
|
+
### Step 3 — Pair with your phone
|
|
40
|
+
|
|
41
|
+
In the phone app tap **Scan to pair** and scan the QR (or type the pairing code manually). The code is single-use and valid for about 10 minutes.
|
|
42
|
+
|
|
43
|
+
- Once bound, later starts print "connected account — open the app and pick this computer" and do not refresh the code. To unbind, see the app settings.
|
|
44
|
+
|
|
45
|
+
### Step 4 — Use it from your phone
|
|
46
|
+
|
|
47
|
+
In the app, open this computer and you can start agents/sessions, send messages, watch streaming output, approve tool requests, answer structured questions, and abort a running session.
|
|
48
|
+
|
|
49
|
+
## Configuration
|
|
50
|
+
|
|
51
|
+
The plugin is configured through the profile's `cordis.yml` (fields below) or env vars.
|
|
52
|
+
|
|
53
|
+
| Field / env | Default | Description |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `relayUrl` / `TUNNELBOX_RELAY_URL` | built-in default | tunnelbox relay address |
|
|
56
|
+
| `provider` | `deepseek-official` | LLM provider |
|
|
57
|
+
| `model` | `deepseek-v4-flash` | Model |
|
|
58
|
+
| `cwd` | `process.cwd()` | Agent working directory (sessions persist per-workspace) |
|
|
59
|
+
| `DSH_PERMISSION_MODE` | - | `danger-full-access` = full access (approval never prompts on the phone) |
|
|
60
|
+
|
|
61
|
+
Example profile overlay (`cordis.patch.yml`):
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
- id: tunnelbox-dsh
|
|
65
|
+
config:
|
|
66
|
+
relayUrl: 'wss://chat.example.com'
|
|
67
|
+
model: 'deepseek-v4-flash'
|
|
68
|
+
cwd: 'D:/workspace/project'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Capabilities
|
|
72
|
+
|
|
73
|
+
| Capability | Value | Notes |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| streaming | ✅ | dsh session events → live deltas |
|
|
76
|
+
| thinking | ✅ | `reasoning-delta` → thinking parts |
|
|
77
|
+
| permission | ✅ | dsh approval requests → phone approval card (timeout = fail-closed deny) |
|
|
78
|
+
| commands | ✅ | `/new`, `/help` |
|
|
79
|
+
| abort | ✅ | `agent.cancel` → phone stop button |
|
|
80
|
+
| questions | ✅ | `ask_user_question` tool → structured phone question card |
|
|
81
|
+
|
|
82
|
+
## Approvals & security
|
|
83
|
+
|
|
84
|
+
- Approval policy is governed by dsh's `approval` / `sandbox-policy` (default `workspace-write` + ask). With both the dsh web UI and your phone present, approvals/questions show on both — whoever answers first decides (the other side is cancelled automatically).
|
|
85
|
+
- `DSH_PERMISSION_MODE=danger-full-access` fully disables prompts (approval policy becomes `never`; no phone card).
|
|
86
|
+
- Don't expose sensitive project directories to an untrusted phone.
|
|
87
|
+
|
|
88
|
+
## Running multiple instances
|
|
89
|
+
|
|
90
|
+
Each `dsh --profile <name>` is an independent process, naturally isolated (own cwd/model/tools/approval policy):
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
DSH_HOME=~/.dsh-a dsh --profile tunnelbox --patch ./a.patch.yml # project A + workspace-write
|
|
94
|
+
DSH_HOME=~/.dsh-b DSH_PERMISSION_MODE=danger-full-access dsh --profile tunnelbox --patch ./b.patch.yml
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Each instance appears separately on the phone by `type=dsh` + its own agentID.
|
|
98
|
+
|
|
99
|
+
## Multilingual
|
|
100
|
+
|
|
101
|
+
User-visible output supports 8 languages (`zh-CN` / `zh-TW` / `en-US` / `ja-JP` / `ko-KR` / `fr-FR` / `de-DE` / `es-ES`). Resolution order: `TUNNELBOX_LANG` > saved `remote-state.dsh.json.lang` > system locale > `en-US`.
|
|
102
|
+
|
|
103
|
+
## Troubleshooting
|
|
104
|
+
|
|
105
|
+
| Problem | Fix |
|
|
106
|
+
|---|---|
|
|
107
|
+
| No QR / pairing code on screen | Restart dsh; the plugin prints it at startup |
|
|
108
|
+
| Plugin layer missing in the profile | `dsh plugin --profile tunnelbox add @tunnelbox/dsh-tunnelbox`, then `--dump-config` |
|
|
109
|
+
| Phone asks for credentials/relay mismatch | Confirm `relayUrl` / `TUNNELBOX_RELAY_URL`; check `~/.tunnelbox/tunnelbox.log` |
|
|
110
|
+
| Use your own relay | Set `relayUrl` in the profile config or `TUNNELBOX_RELAY_URL` |
|
|
111
|
+
|
|
112
|
+
## State files
|
|
113
|
+
|
|
114
|
+
- `~/.tunnelbox/remote-state.dsh.json` — agentID / relay / bound state / language
|
|
115
|
+
- `~/.tunnelbox/remote-pairing.json` — latest pairing info
|
|
116
|
+
- `~/.tunnelbox/tunnelbox.log` — plugin log
|
|
117
|
+
|
|
118
|
+
## Uninstall
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
dsh plugin --profile tunnelbox remove @tunnelbox/dsh-tunnelbox
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Remove `~/.tunnelbox` (all adapters' shared state) only if you no longer use any tunnelbox adapter.
|
|
125
|
+
|
|
126
|
+
## Development
|
|
127
|
+
|
|
128
|
+
Implementation details (protocol mapping, source layout, design decisions, untested items) are kept in the source repository as `DEV.md` next to this package, plus the protocol spec under the repo's `docs/`.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# @tunnelbox/dsh-tunnelbox
|
|
2
|
+
|
|
3
|
+
[English](README.md) · [简体中文](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
**官网:** [www.tunnelbox.top](https://www.tunnelbox.top)
|
|
6
|
+
|
|
7
|
+
**tunnelbox DeepSeek Harness(dsh)原生 Cordis 插件**:在电脑上运行 dsh,用手机远程驱动完整的 DeepSeek Harness——agent / session / 工具 / 审批 / 中止。它跑在 **dsh(Cordis)进程内**,只向中继发出站连接(无需公网 IP / 端口映射)。
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
手机 App ──WSS──► relay ──WSS──► 本插件(dsh 进程内) ──ctx.agents/session/approval──► DeepSeek Harness
|
|
11
|
+
(dsh --profile tunnelbox)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 快速上手(安装 → 运行 → 配对 → 使用)
|
|
15
|
+
|
|
16
|
+
在装有 DeepSeek Harness 的电脑上,按以下步骤操作一次即可。
|
|
17
|
+
|
|
18
|
+
### 第 0 步 — 准备手机
|
|
19
|
+
|
|
20
|
+
在官网下载并安装 tunnelbox App(Android / iOS 均已上架):**https://www.tunnelbox.top**
|
|
21
|
+
|
|
22
|
+
- 按提示登录/注册账号。
|
|
23
|
+
|
|
24
|
+
### 第 1 步 — 安装插件到 dsh profile
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
dsh plugin --profile tunnelbox add @tunnelbox/dsh-tunnelbox
|
|
28
|
+
dsh --profile tunnelbox --dump-config # 可选:确认已含 tunnelbox-dsh 插件层
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 第 2 步 — 用该 profile 运行 dsh
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
dsh --profile tunnelbox
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
dsh 启动 harness 与本插件,插件连接中继并在终端打印**配对二维码 + 配对码**。凭证自动读取 `$DSH_HOME/.credentials.yaml`(默认 `~/.dsh/`)。
|
|
38
|
+
|
|
39
|
+
### 第 3 步 — 与手机配对
|
|
40
|
+
|
|
41
|
+
在手机 App 点「扫一扫配对」,扫描二维码(或手动输入配对码)。配对码一次性有效,约 10 分钟。
|
|
42
|
+
|
|
43
|
+
- 绑定后,之后的启动会打印「已绑定账号,从手机「我的电脑」直接连接」,不再刷新码;换手机需先在 App 设置解绑。
|
|
44
|
+
|
|
45
|
+
### 第 4 步 — 在手机上使用
|
|
46
|
+
|
|
47
|
+
在 App 里打开这台电脑,即可启动 agent/会话、发消息、看流式输出、审批工具请求、回答结构化提问、中止运行中的会话。
|
|
48
|
+
|
|
49
|
+
## 配置
|
|
50
|
+
|
|
51
|
+
插件经 profile 的 `cordis.yml`(下列字段)或环境变量配置。
|
|
52
|
+
|
|
53
|
+
| 字段 / 环境变量 | 默认 | 说明 |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `relayUrl` / `TUNNELBOX_RELAY_URL` | 构建注入默认 | tunnelbox 中继地址 |
|
|
56
|
+
| `provider` | `deepseek-official` | LLM provider |
|
|
57
|
+
| `model` | `deepseek-v4-flash` | 模型 |
|
|
58
|
+
| `cwd` | `process.cwd()` | agent 工作目录(会话按工作区分目录持久化) |
|
|
59
|
+
| `DSH_PERMISSION_MODE` | - | `danger-full-access` = 全放开(审批不再弹手机卡) |
|
|
60
|
+
|
|
61
|
+
profile overlay 示例(cordis.patch.yml):
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
- id: tunnelbox-dsh
|
|
65
|
+
config:
|
|
66
|
+
relayUrl: 'wss://chat.example.com'
|
|
67
|
+
model: 'deepseek-v4-flash'
|
|
68
|
+
cwd: 'D:/workspace/project'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 能力位
|
|
72
|
+
|
|
73
|
+
| 能力 | 值 | 说明 |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| streaming | ✅ | dsh 会话事件 → 实时增量 |
|
|
76
|
+
| thinking | ✅ | `reasoning-delta` → thinking 部件 |
|
|
77
|
+
| permission | ✅ | dsh 审批请求 → 手机审批卡(超时 fail-closed 拒绝) |
|
|
78
|
+
| commands | ✅ | `/new`、`/help` |
|
|
79
|
+
| abort | ✅ | `agent.cancel` → 前端「停止」 |
|
|
80
|
+
| questions | ✅ | `ask_user_question` 工具 → 手机结构化提问卡 |
|
|
81
|
+
|
|
82
|
+
## 审批与安全
|
|
83
|
+
|
|
84
|
+
- 审批策略由 dsh 的 `approval` / `sandbox-policy` 决定(默认 `workspace-write` + ask)。当 dsh web UI 与手机同时在时,审批/提问两端同显——**谁先答谁得**,另一端自动取消。
|
|
85
|
+
- `DSH_PERMISSION_MODE=danger-full-access` 完全关闭弹卡(approval policy 变 `never`,手机不再显示审批卡)。
|
|
86
|
+
- 请勿把敏感工程目录暴露给不受信手机。
|
|
87
|
+
|
|
88
|
+
## 多实例隔离
|
|
89
|
+
|
|
90
|
+
每个 `dsh --profile <name>` 是独立进程,天然隔离(各自 cwd/模型/工具集/审批策略):
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
DSH_HOME=~/.dsh-a dsh --profile tunnelbox --patch ./a.patch.yml # 工程 A + workspace-write
|
|
94
|
+
DSH_HOME=~/.dsh-b DSH_PERMISSION_MODE=danger-full-access dsh --profile tunnelbox --patch ./b.patch.yml
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
手机端每个实例按 `type=dsh` + 独立 agentID 区分。
|
|
98
|
+
|
|
99
|
+
## 多语言
|
|
100
|
+
|
|
101
|
+
用户可见输出支持 8 种语言(`zh-CN` / `zh-TW` / `en-US` / `ja-JP` / `ko-KR` / `fr-FR` / `de-DE` / `es-ES`)。解析顺序:`TUNNELBOX_LANG` > `remote-state.dsh.json` 的 `lang` > 系统 locale > 默认 `en-US`。
|
|
102
|
+
|
|
103
|
+
## 故障排查
|
|
104
|
+
|
|
105
|
+
| 问题 | 解决 |
|
|
106
|
+
|---|---|
|
|
107
|
+
| 没有二维码/配对码 | 重启 dsh;插件启动时会打印 |
|
|
108
|
+
| profile 里没有插件层 | `dsh plugin --profile tunnelbox add @tunnelbox/dsh-tunnelbox`,再 `--dump-config` |
|
|
109
|
+
| 手机连不上/中继不符 | 确认 `relayUrl` / `TUNNELBOX_RELAY_URL`;查看 `~/.tunnelbox/tunnelbox.log` |
|
|
110
|
+
| 使用自建中继 | 在 profile 配置设 `relayUrl`,或设 `TUNNELBOX_RELAY_URL` |
|
|
111
|
+
|
|
112
|
+
## 状态文件
|
|
113
|
+
|
|
114
|
+
- `~/.tunnelbox/remote-state.dsh.json` — agentID / 中继地址 / 绑定状态 / 语言
|
|
115
|
+
- `~/.tunnelbox/remote-pairing.json` — 最新配对信息
|
|
116
|
+
- `~/.tunnelbox/tunnelbox.log` — 插件日志
|
|
117
|
+
|
|
118
|
+
## 卸载
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
dsh plugin --profile tunnelbox remove @tunnelbox/dsh-tunnelbox
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
仅当不再使用任何 tunnelbox 适配器时,才删除 `~/.tunnelbox`(各适配器共享状态)。
|
|
125
|
+
|
|
126
|
+
## 开发
|
|
127
|
+
|
|
128
|
+
实现细节(协议映射、源码结构、决策记录、待实测项)保存在源码仓库中本包旁的 `DEV.md` 与仓库 `docs/` 下。
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tunnelbox/dsh-tunnelbox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "tunnelbox 的 dsh 原生 Cordis 插件:手机远程驱动 DeepSeek Harness(agent/session/tools/审批/中止)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
-
"cordis.patch.yml"
|
|
9
|
+
"cordis.patch.yml",
|
|
10
|
+
"README.md",
|
|
11
|
+
"README.zh-CN.md"
|
|
10
12
|
],
|
|
11
13
|
"publishConfig": {
|
|
12
14
|
"access": "public"
|