@ds-hu/dsh-tailcat-remote 0.0.0-stage → 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 the dsh-tailcat-remote authors
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/NOTICE ADDED
@@ -0,0 +1,33 @@
1
+ dsh-tailcat-remote
2
+ Copyright (c) 2026 the dsh-tailcat-remote authors
3
+
4
+ This product is MIT-licensed (see LICENSE).
5
+
6
+ Peer dependency
7
+ The package declares a peer dependency on @deepseek-ai/schemastery, which the
8
+ DeepSeek Harness installation supplies. It is used only for the Config schema;
9
+ every runtime capability — the web server, the authenticated Fetch seam, the
10
+ connection/cookie checks, the subprocess provider, the logger — is reached
11
+ through the Cordis context object.
12
+
13
+ QR Code Generator
14
+ vendor/qrcode.mjs is qrcode-generator 1.4.4 by Kazuhiko Arase.
15
+ Copyright (c) 2009 Kazuhiko Arase.
16
+ Licensed under the MIT license; the original header is retained in the file.
17
+ Source: https://github.com/kazuhikoarase/qrcode-generator
18
+ The word "QR Code" is a registered trademark of DENSO WAVE INCORPORATED.
19
+
20
+ tailcat
21
+ tailcat is a separate program by Tailscale Inc & contributors, licensed
22
+ under the BSD 3-Clause License. It is not bundled with this package. The
23
+ plugin can install a verified, user-local copy on request, or use a
24
+ pre-existing installation; it starts that executable and parses its output.
25
+ Copyright (c) 2020 Tailscale Inc & contributors.
26
+ Source: https://github.com/tailscale/tailcat
27
+
28
+ Original material
29
+ The Host runtime (door, supervisor, control route, state), the client
30
+ modules, the zh/en dictionaries, the icon (icon.svg) and the documentation
31
+ were written for this project. "DeepSeek", "DeepSeek Harness" and
32
+ "Tailscale" are names of their respective platforms and projects, not a
33
+ claim of endorsement.
package/README.en.md ADDED
@@ -0,0 +1,115 @@
1
+ <p align="center">
2
+ <img src="icon.svg" width="88" alt="Remote Access: a cat-eared keyhole">
3
+ </p>
4
+
5
+ <h1 align="center">Remote Access</h1>
6
+
7
+ <p align="center">
8
+ <strong>Reach DeepSeek Harness from any network through tailcat — no public port, no inbound firewall change.</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@ds-hu/dsh-tailcat-remote"><img alt="npm" src="https://img.shields.io/npm/v/@ds-hu/dsh-tailcat-remote?color=0F766E"></a>
13
+ <a href="https://github.com/ds-hu/dsh-tailcat-remote/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/ds-hu/dsh-tailcat-remote/actions/workflows/ci.yml/badge.svg"></a>
14
+ <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-0F766E"></a>
15
+ <a href="README.md">中文</a>
16
+ </p>
17
+
18
+ ---
19
+
20
+ ## What it is
21
+
22
+ DeepSeek Harness listens on the local machine by default. Opening the same GUI from a laptop, phone, or another computer usually means a public port, port forwarding, or a reverse proxy.
23
+
24
+ Remote Access folds that into one plugin. The Host supervises a `tailcat` process and a tailnet-only local door. The client needs a tailcat address and one command.
25
+
26
+ <p align="center">
27
+ <img src="docs/screenshots/01-pairing.png" alt="Remote Access page: a running tunnel, the tailcat address, QR code, client command, and three usage steps" width="820">
28
+ </p>
29
+
30
+ ## What you get
31
+
32
+ - **One address across networks.** No public port. tailcat uses a DERP relay or a direct path, and the browser finally talks to the client's own `127.0.0.1`.
33
+ - **Scan or copy to pair.** The page shows the address, a QR code, and the exact `tailcat forward …` command, with the three steps beside them.
34
+ - **A key allow-list.** The address is the only credential by default. Add client public keys and unauthorized devices are refused during the tailcat handshake.
35
+ - **Rotate the address, manage the process.** Start, stop, restart, and rotate from the sidebar; inspect the relay region, recent connections, refusals, and errors.
36
+ - **Log in once.** The first remote visit runs the normal DSH login flow and then keeps an HttpOnly cookie. The token never appears in the remote URL.
37
+ - **The same page locally and remotely.** The panel works through DSH's owner API, so both views behave alike.
38
+
39
+ <p align="center">
40
+ <img src="docs/screenshots/02-security.png" alt="Security section: the red address-is-the-key warning, client public-key allow-list, and two-step address rotation" width="820">
41
+ </p>
42
+
43
+ ## Install
44
+
45
+ Add the plugin to the web profile:
46
+
47
+ ```sh
48
+ dsh plugin --profile web add @ds-hu/dsh-tailcat-remote
49
+ ```
50
+
51
+ List the package in the profile's `dsh.profile.bundles`, then restart `dsh web`:
52
+
53
+ ```json
54
+ {
55
+ "dsh": {
56
+ "profile": {
57
+ "bundles": ["…", "@ds-hu/dsh-tailcat-remote"]
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ Installing the bundle from **Plugin Manager** has the same effect.
64
+
65
+ ### tailcat installation is managed
66
+
67
+ Restart `dsh web` and open **Remote Access**. If the Host has no tailcat, the page shows an install card:
68
+
69
+ - **Linux / Windows:** click **Install tailcat**. The plugin selects the official tailcat v0.8.0 asset for `process.arch`, downloads it, verifies its SHA-256 against the official `checksums.txt`, and extracts it to `$DSH_HOME/tailcat-remote/bin/`. The system `PATH` is not modified.
70
+ - **macOS:** if Homebrew is available, the same button updates Homebrew and installs/upgrades tailcat (0.8.0 or newer), then copies the executable into the managed directory. Intel Macs have no bottle, so Homebrew builds from source and can take several minutes. Without Homebrew, the page shows a clear message and a manual-install link.
71
+ - **Your own tailcat:** on startup the plugin checks `PATH` and common package locations (`/opt/homebrew/bin`, `/usr/local/bin`, `/usr/bin`, and so on). It uses an existing install directly and never downloads over it. The diagnostics section shows the executable's source and version.
72
+ - **Other platforms or architectures:** install tailcat manually (0.8.0 or newer) from [the upstream instructions](https://github.com/tailscale/tailcat#install), then point `binaryPath` at it. `binaryPath` takes precedence over the managed copy.
73
+
74
+ <p align="center">
75
+ <img src="docs/screenshots/03-install.png" alt="Install card shown when tailcat is missing: detection, method, checksum note, and the one-click button" width="820">
76
+ </p>
77
+
78
+ The managed install only runs after you click the button: there is no background download and no per-platform binary payload in the npm package.
79
+
80
+ > Automatic installation covers the **Host-side** tailcat server only. The client device still needs its own tailcat to run `tailcat forward`; this plugin does not include a client program.
81
+
82
+ ## Use
83
+
84
+ 1. Restart Harness and open **Remote Access** in the sidebar.
85
+ 2. If the page reports a missing tailcat, click **Install tailcat** first; otherwise wait for **Online** and the address. The first start creates a saved key and probes a DERP region, which can take a minute.
86
+ 3. On the client device, install tailcat and run the command shown on the page, or scan the QR code for the address:
87
+
88
+ ```sh
89
+ tailcat forward tc… 18080:13080
90
+ ```
91
+
92
+ 4. Open `http://127.0.0.1:18080/` in the client browser. The first visit completes DSH login; later visits go straight in.
93
+ 5. Before sharing the address, add at least one client public key in **Security**.
94
+
95
+ ## Security
96
+
97
+ The tailcat address is a credential. In address-only mode, anyone who has it can reach the DSH login entry and receive a browser session bound to the remote authority.
98
+
99
+ - Pair the address with a key allow-list: run `tailcat genkey --client --key=client-default` on the client and add the printed public key on the page.
100
+ - Rotating the address invalidates the old one immediately. Browsers that already hold a DSH cookie are not signed out; use DSH's session management for that.
101
+ - Do not expose port 3080 directly. The plugin lets tailcat reach a single 0600 Unix-socket door and opens no public listener.
102
+ - If the Web listener uses HTTPS, the door refuses to start; this version does not replay cookies behind TLS.
103
+
104
+ The full threat model, limitations, and checklist are in [Security](docs/SECURITY.md).
105
+
106
+ ## Docs
107
+
108
+ - [Technical notes](docs/TECHNICAL.md): door, supervisor, request path, lifecycle, failure modes.
109
+ - [Host ↔ panel contract](docs/CONTRACT.md): JSON API, state fields, error codes.
110
+ - [Security](docs/SECURITY.md): trust boundaries, credentials, rotation, limitations.
111
+ - [NOTICE](NOTICE): qrcode-generator and tailcat attribution.
112
+
113
+ ## License
114
+
115
+ MIT — see [LICENSE](LICENSE) and [NOTICE](NOTICE).
package/README.md CHANGED
@@ -1,3 +1,115 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <img src="icon.svg" width="88" alt="远程访问:猫耳钥匙孔图标">
3
+ </p>
2
4
 
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.
5
+ <h1 align="center">远程访问 · Remote Access</h1>
6
+
7
+ <p align="center">
8
+ <strong>用 tailcat 把 DeepSeek Harness 带到任何网络,不用开公网端口,不用改入站防火墙。</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@ds-hu/dsh-tailcat-remote"><img alt="npm" src="https://img.shields.io/npm/v/@ds-hu/dsh-tailcat-remote?color=0F766E"></a>
13
+ <a href="https://github.com/ds-hu/dsh-tailcat-remote/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/ds-hu/dsh-tailcat-remote/actions/workflows/ci.yml/badge.svg"></a>
14
+ <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-0F766E"></a>
15
+ <a href="README.en.md">English</a>
16
+ </p>
17
+
18
+ ---
19
+
20
+ ## 它解决什么
21
+
22
+ DeepSeek Harness 默认只在本机监听。想从笔记本、手机或另一台电脑打开同一个界面,通常要公网端口、端口转发或一层反向代理。
23
+
24
+ 远程访问把这件事收进一个插件:Host 负责托管 `tailcat` 进程和一条 tailnet-only 的本地门卫,客户端只需要 tailcat 地址和一行命令。
25
+
26
+ <p align="center">
27
+ <img src="docs/screenshots/01-pairing.png" alt="远程访问页:运行中的隧道、tailcat 地址、二维码、客户端命令和三个使用步骤" width="820">
28
+ </p>
29
+
30
+ ## 能带来什么
31
+
32
+ - **一个地址,跨网络进入。** 不开公网端口,`tailcat` 走 DERP 中继或直连,浏览器最终访问客户端自己的 `127.0.0.1`。
33
+ - **扫码或复制即可配对。** 页面给出地址、二维码和完整的 `tailcat forward …` 命令,三步说明就写在旁边。
34
+ - **白名单限制谁能连。** 默认只有地址这一把钥匙;添加客户端公钥后,未授权设备在 tailcat 握手阶段就被拒绝。
35
+ - **地址可换,进程可管。** 侧边栏里启动、停止、重启、轮换地址,查看中继区域、最近连接、拒绝记录和错误信息。
36
+ - **登录仍然只有一次。** 第一次打开远程地址会走正常的 DSH 登录流程,之后浏览器沿用 HttpOnly cookie;token 不会出现在远程 URL 里。
37
+ - **本机与远程同一页。** 页面本身通过 DSH 的 owner API 工作,在本机操作和远程操作一致。
38
+
39
+ <p align="center">
40
+ <img src="docs/screenshots/02-security.png" alt="安全区:地址即钥匙的红色警告、客户端公钥白名单和两步确认的地址轮换" width="820">
41
+ </p>
42
+
43
+ ## 安装
44
+
45
+ 把插件装进 web profile:
46
+
47
+ ```sh
48
+ dsh plugin --profile web add @ds-hu/dsh-tailcat-remote
49
+ ```
50
+
51
+ 把包加进 profile 的 `dsh.profile.bundles`,然后重启 `dsh web`:
52
+
53
+ ```json
54
+ {
55
+ "dsh": {
56
+ "profile": {
57
+ "bundles": ["…", "@ds-hu/dsh-tailcat-remote"]
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ 也可以在 **插件管理** 里安装这个 bundle,效果相同。
64
+
65
+ ### tailcat 会自动安装
66
+
67
+ 重启 `dsh web` 后打开 **远程访问**。如果 Host 还没有 tailcat,页面会显示安装卡片:
68
+
69
+ - **Linux / Windows**:点 **一键安装 tailcat**。插件会按 `process.arch` 选择 tailcat 官方 v0.8.0 release 资产,下载后用官方 `checksums.txt` 校验 SHA-256,再解压到 `$DSH_HOME/tailcat-remote/bin/`。不修改系统 `PATH`。
70
+ - **macOS**:如果 Host 有 Homebrew,点同一个按钮会先更新 Homebrew,再安装/升级 tailcat(需要 0.8.0 或更新),然后把可执行文件复制到受管目录。Intel Mac 没有现成 bottle,Homebrew 会从源码构建,可能比 Apple Silicon 慢几分钟。没有 Homebrew 时,页面会给出明确提示和手动安装链接。
71
+ - **已经自己安装过 tailcat**:插件启动时会检查 `PATH`,以及 `/opt/homebrew/bin`、`/usr/local/bin`、`/usr/bin` 等常见位置。检测到就直接使用,不会下载,也不会覆盖你的安装。诊断区会显示可执行文件来源和版本。
72
+ - **其他平台或架构**:自动安装不可用时,按 [tailcat 安装说明](https://github.com/tailscale/tailcat#install) 手动安装(需要 0.8.0 或更新),再用 `binaryPath` 指向它。`binaryPath` 的优先级高于受管安装。
73
+
74
+ <p align="center">
75
+ <img src="docs/screenshots/03-install.png" alt="缺少 tailcat 时的安装卡片:检测结果、安装方式、校验说明和一键安装按钮" width="820">
76
+ </p>
77
+
78
+ 受管安装只在点击按钮时发生:插件不会在后台静默下载,也不把各平台二进制塞进 npm 包。
79
+
80
+ > 自动安装只针对 **Host 端**的 tailcat 服务进程。要访问 Harness 的客户端设备仍然需要自己安装 tailcat,用来运行 `tailcat forward`;本插件不包含客户端程序。
81
+
82
+ ## 使用
83
+
84
+ 1. 重启 Harness,侧边栏打开 **远程访问**。
85
+ 2. 如果页面提示缺少 tailcat,先点 **一键安装 tailcat**;否则确认状态是 **运行中**,地址和二维码已经出现。首次启动要生成保存密钥并探测 DERP 区域,可能需要一分钟。
86
+ 3. 在要访问的客户端设备上安装 tailcat,运行页面给出的命令,或者扫描二维码取得地址:
87
+
88
+ ```sh
89
+ tailcat forward tc… 18080:13080
90
+ ```
91
+
92
+ 4. 在客户端浏览器打开 `http://127.0.0.1:18080/`。第一次会完成 DSH 登录,之后直接进入。
93
+ 5. 分享地址前,建议先在 **安全** 区添加至少一个客户端公钥。
94
+
95
+ ## 安全
96
+
97
+ `tailcat` 地址就是一份凭据。没有白名单时,拿到地址的人就能到达 DSH 登录入口,并自动获得一个绑定了远程 authority 的浏览器会话。
98
+
99
+ - 给地址配白名单:客户端运行 `tailcat genkey --client --key=client-default`,把打印的公钥加进页面。
100
+ - 更换地址后,旧地址立即失效。已经拿到 DSH cookie 的浏览器不会自动退出,需要按 DSH 的会话管理单独处理。
101
+ - 不要直接暴露 3080。在 Linux/macOS 上,插件只让 tailcat 通过一条 0600 的 Unix socket 访问 door;Windows 没有 tailcat Unix-socket 支持,默认使用仅绑定 `127.0.0.1` 的 TCP 端口,仍不对局域网或公网开放。
102
+ - 如果 Web listener 是 HTTPS,door 会拒绝启动;当前版本不支持在 TLS 后面重放 cookie。
103
+
104
+ 完整威胁模型、限制和检查清单见 [安全说明](docs/SECURITY.md)。
105
+
106
+ ## 文档
107
+
108
+ - [技术说明](docs/TECHNICAL.md):door、supervisor、请求路径、生命周期、失败模式。
109
+ - [Host ↔ 面板契约](docs/CONTRACT.md):JSON API、状态字段、错误码。
110
+ - [安全说明](docs/SECURITY.md):信任边界、凭据、轮换、已知限制。
111
+ - [NOTICE](NOTICE):qrcode-generator 与 tailcat 的第三方归属。
112
+
113
+ ## 许可
114
+
115
+ MIT,见 [LICENSE](LICENSE) 与 [NOTICE](NOTICE)。