@deepseek-ai/dsh-ssh 0.1.6-alpha.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 DeepSeek
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.
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/ssh/ssh/README.md
5
+ README.md: 727ab6eefae6bf8361f41b2f1a4a7f85e7225226
6
+ README.zh.md: 5548886d1c95e551330ecae9aaf24b4015cb3197
package/README.md ADDED
@@ -0,0 +1,104 @@
1
+ ---
2
+ description: "OpenSSH connection configuration and remote helper lifecycle for deployments composing POSIX file, process and sandbox providers."
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-ssh
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ `dsh-ssh` connects a POSIX Harness host to an installed helper on a POSIX SSH host. One deployment-owned OpenSSH alias supplies authentication and host identity; the paired filesystem, subprocess and sandbox providers use that connection. The connection verifies installed artifact digests before readiness; the helper owns remote cleanup when the connection closes or its lease expires.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ Compose this service with [`fs-ssh`](../fs-ssh/README.md), [`subprocess-ssh`](../subprocess-ssh/README.md) and [`sandbox-ssh`](../sandbox-ssh/README.md) in a custom `dsh` profile. The host runs the Harness, model transport and Session storage; the remote machine supplies the files and processes. Headless profiles support this arrangement.
29
+
30
+ ### Deployment prerequisites
31
+
32
+ Both endpoints require Linux or macOS. The local `ssh` command must support connection multiplexing and Unix-socket forwarding; the server must permit that forwarding. Configure the alias, credentials and known-host entry before startup: the service enables `BatchMode`, requires strict host-key checking, disables agent forwarding and adds no interactive authentication flow.
33
+
34
+ Install the built helper and its matching runtime dependencies on the remote host. Keep Node, helper, bootstrap and their dependencies outside the workspace and writable temporary roots. They must also remain outside a backend’s replaced temporary tree, such as bwrap’s private `/tmp`; the workspace may still be under `/tmp`. Digest verification detects an unexpected installed artifact after helper startup; it does not make writable deployment files safe to execute or authenticate a malicious SSH host.
35
+
36
+ | Field | Default | Meaning |
37
+ |---|---|---|
38
+ | `host` | required | Existing OpenSSH host alias |
39
+ | `node`, `helper`, `workspace` | required | Absolute remote Node executable, bundled helper entry and default workspace |
40
+ | `helperHash` | required | Lowercase SHA-256 of the installed helper entry |
41
+ | `bootstrapPath`, `bootstrapHash` | omitted | Paired remote PTC entry and its lowercase SHA-256 |
42
+ | `requestTimeoutMs` | `30000` | Connection and administrative-request deadline, from 1 through 2,147,483,647 ms |
43
+ | `maxFrameBytes` | `67108864` | Per-message JSON payload ceiling, at most 64 MiB |
44
+ | `maxPending` | `128` | Ordinary outstanding requests; heartbeat and bounded cleanup requests have reserved capacity |
45
+ | `leaseMs` | `30000` | Helper heartbeat lease, from 3000 to 600000 ms |
46
+
47
+ For PTC, configure both bootstrap fields and pass the verified `ctx.ssh.nodeExecutable` and `ctx.ssh.bootstrapPath` to [`NodePtcRuntime`](../../ptc-runtime/ptc-runtime-node/README.md). Basic filesystem and Bash use may omit the pair. The `bootstrapPath` getter refuses an unconfigured PTC deployment.
48
+
49
+ -----
50
+
51
+ <a id="understand-the-implementation"></a>
52
+ ## Understand the implementation
53
+
54
+ <details>
55
+ <summary>Implementation internals — click to expand</summary>
56
+
57
+ The OpenSSH master carries private administrative RPC. Each program stream uses a separate forwarded Unix socket and an independent SSH channel. Program stdout cannot forge administrative replies or occupy the control stream’s channel window. SSH transport congestion still affects the shared connection.
58
+
59
+ Each stream reservation has a random 256-bit TLS pre-shared key carried only by administrative RPC. TLS authenticates both endpoints and protects every stream byte; the key is never sent as a stream preface. Socket directories are private (`0700`) and sockets use `0600`. Replacing a writable socket path cannot impersonate an endpoint or reveal the stream key; an attacker can still interrupt service or relay opaque TLS records.
60
+
61
+ Connection disposal joins forwarding and cancellation subprocesses and partially established streams before removing local resources. Transport loss rejects pending operations and invalidates the connection. The helper starts managed cleanup on SSH EOF, termination signals or heartbeat expiry. A disconnected client cannot confirm the remote outcome; operations are never reconnected or replayed automatically.
62
+
63
+ Failed startup and process results release their reservations after native quiescence; the bounded completion cache preserves the original rejection for later result reads. Helper shutdown also joins endpoint and directory cleanup already in progress.
64
+
65
+ The helper starts with `--disable-sigusr1`, so a same-user process signal cannot open its Node debugger.
66
+
67
+ </details>
68
+
69
+ -----
70
+
71
+ <a id="further-exploration"></a>
72
+ ## Further Exploration
73
+
74
+ - [SSH subsystem](../../../docs/subsystems/ssh.md) — execution coordinates, transport semantics and lifecycle ownership.
75
+ - [POSIX SSH decision](../../../.agents/notes/implemented/architecture/2026-09-11-posix-ssh-runtime.md) — rationale, alternatives and required verification.
76
+
77
+ -----
78
+
79
+ <a id="model-experience"></a>
80
+ ## Model Experience
81
+
82
+ None, as host aliases, authentication and stream capabilities are private deployment details and consumers own every model-visible operation.
83
+
84
+ #### KV Cache effect
85
+
86
+ This provider contributes no request-prefix content. Its consumers own model-visible tools and results.
87
+
88
+ ## Known Limitations and Deferred Work
89
+
90
+ <a id="known-limitations-and-deferred-work"></a>
91
+
92
+ - No Windows endpoint, automatic provisioning, reconnect or replay is supplied.
93
+ - Web workspace UI paths still assume host filesystem access; use headless or a custom composition whose consumers honor provider paths.
94
+ - TLS stream keys do not protect against remote OS process-memory inspection or debugging. File-effect policy retains the selected sandbox backend’s limits.
95
+
96
+ <a id="dev-note"></a>
97
+ ### Dev Note
98
+
99
+ <details>
100
+ <summary>Working context for maintainers — click to expand</summary>
101
+
102
+ No invariant companion is published. Wire validation and the owning filesystem, subprocess and sandbox providers enforce the observable obligations; this adapter adds no independently observed state relation.
103
+
104
+ </details>
package/README.zh.md ADDED
@@ -0,0 +1,104 @@
1
+ ---
2
+ description: "面向组合 POSIX 文件、进程与沙箱提供方的部署者,说明 OpenSSH 连接配置及远端辅助进程生命周期。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-ssh
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ `dsh-ssh` 将 POSIX Harness 主机连接到 POSIX SSH 主机上已安装的辅助程序。部署方持有的 OpenSSH 主机别名提供认证与主机身份;配套的文件系统、子进程和沙箱提供方共享该连接。连接在就绪前验证已安装产物的摘要;辅助程序在连接关闭或租期到期时负责远端清理。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [进一步探索](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与延后工作](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用本包
27
+
28
+ 在自定义 `dsh` 配置组合中,将本服务与 [`fs-ssh`](../fs-ssh/README.zh.md)、[`subprocess-ssh`](../subprocess-ssh/README.zh.md) 和 [`sandbox-ssh`](../sandbox-ssh/README.zh.md) 组合。主机运行 Harness、模型传输和 Session 存储;远端机器提供文件与进程。headless 配置组合支持这种安排。
29
+
30
+ ### 部署前提
31
+
32
+ 两端均需运行 Linux 或 macOS。本地 `ssh` 命令必须支持连接复用与 Unix 套接字转发,服务器也必须允许该转发。启动前配置主机别名、凭据与已知主机记录:本服务启用 `BatchMode`、要求严格检查主机密钥、禁用认证代理转发,且不提供交互认证流程。
33
+
34
+ 在远端主机安装已构建的辅助程序及其匹配的运行依赖。Node、辅助程序、引导程序及其依赖必须位于工作区和可写临时目录之外,也必须位于后端会替换的临时目录树之外,例如 bwrap 的私有 `/tmp`;工作区仍可位于 `/tmp` 下。摘要校验在辅助程序启动后发现非预期的已安装产物;它不能保证可写部署文件的执行安全,也不能认证恶意 SSH 主机。
35
+
36
+ | 字段 | 默认值 | 含义 |
37
+ |---|---|---|
38
+ | `host` | 必填 | 已有的 OpenSSH 主机别名 |
39
+ | `node`、`helper`、`workspace` | 必填 | 远端 Node 可执行文件、辅助程序打包入口和默认工作区的绝对路径 |
40
+ | `helperHash` | 必填 | 已安装辅助程序入口的小写 SHA-256 |
41
+ | `bootstrapPath`、`bootstrapHash` | 省略 | 成对提供的远端 PTC 入口及其小写 SHA-256 |
42
+ | `requestTimeoutMs` | `30000` | 连接与管理请求的截止时限,范围为 1 至 2,147,483,647 毫秒 |
43
+ | `maxFrameBytes` | `67108864` | 每条 JSON 消息的负载上限,最大为 64 MiB |
44
+ | `maxPending` | `128` | 普通未完成请求的数量上限;心跳与有界清理请求使用预留容量 |
45
+ | `leaseMs` | `30000` | 辅助进程心跳租期,范围为 3000 至 600000 毫秒 |
46
+
47
+ 使用 PTC 时,配置两个引导字段,并将验证后的 `ctx.ssh.nodeExecutable` 与 `ctx.ssh.bootstrapPath` 传给 [`NodePtcRuntime`](../../ptc-runtime/ptc-runtime-node/README.zh.md)。仅使用文件系统和 Bash 时可以省略这对字段。未配置 PTC 部署时,`bootstrapPath` getter 会拒绝访问。
48
+
49
+ -----
50
+
51
+ <a id="understand-the-implementation"></a>
52
+ ## 理解实现
53
+
54
+ <details>
55
+ <summary>实现细节 — 点击展开</summary>
56
+
57
+ OpenSSH 主连接承载私有管理 RPC。每条程序流使用独立转发的 Unix 套接字和独立 SSH 通道。程序 stdout 无法伪造管理回复,也不会占用控制流的通道窗口;SSH 传输拥塞仍会影响共享连接。
58
+
59
+ 每个流预留项都有一个随机 256 位 TLS 预共享密钥,仅由管理 RPC 传递。TLS 认证两端并保护流中的每个字节;密钥绝不作为流前缀发送。套接字目录为私有目录(`0700`),套接字使用 `0600` 权限。替换可写套接字路径无法冒充端点或获知流密钥;攻击者仍可中断服务或转发不透明的 TLS 记录。
60
+
61
+ 连接释放会先等待转发与取消子进程,以及尚在建立的流结束,再删除本地资源。传输丢失会拒绝待处理操作并使连接失效。辅助进程在 SSH EOF、终止信号或心跳到期时启动托管清理。断连客户端无法确认远端结果;操作不会自动重连或重放。
62
+
63
+ 启动或进程结果失败后,预留项在原生进程范围清空后释放;有界完成缓存保留原始拒绝结果,供后续读取。辅助程序关闭也会等待已在进行的端点与目录清理。
64
+
65
+ 辅助程序以 `--disable-sigusr1` 启动,因此同用户进程发送的信号无法开启其 Node 调试器。
66
+
67
+ </details>
68
+
69
+ -----
70
+
71
+ <a id="further-exploration"></a>
72
+ ## 进一步探索
73
+
74
+ - [SSH 子系统](../../../docs/subsystems/ssh.zh.md) — 执行坐标、传输语义及生命周期归属。
75
+ - [POSIX SSH 决策](../../../.agents/notes/implemented/architecture/2026-09-11-posix-ssh-runtime.zh.md) — 理由、替代方案及必要验证。
76
+
77
+ -----
78
+
79
+ <a id="model-experience"></a>
80
+ ## 模型体验
81
+
82
+ 无,因为主机别名、认证与流能力令牌属于私有部署细节,每项面向模型的操作均由消费方负责。
83
+
84
+ #### KV Cache 影响
85
+
86
+ 本提供方不贡献请求前缀内容。面向模型的工具与结果由消费方负责。
87
+
88
+ ## 已知限制与延后工作
89
+
90
+ <a id="known-limitations-and-deferred-work"></a>
91
+
92
+ - 不提供 Windows 端点、自动配置远端环境、重连或重放。
93
+ - Web 工作区界面的路径仍假定可访问主机文件系统;请使用 headless 或所有消费方都遵守提供方路径语义的自定义组合。
94
+ - TLS 流密钥不防御远端操作系统级进程内存检查或调试。文件效果策略保留所选沙箱后端的限制。
95
+
96
+ <a id="dev-note"></a>
97
+ ### 开发备注
98
+
99
+ <details>
100
+ <summary>维护者工作上下文 — 点击展开</summary>
101
+
102
+ 本包不发布不变式伴随入口。消息校验及所属文件系统、子进程和沙箱提供方执行可观察的约束;此适配器没有增加可独立观察的状态关系。
103
+
104
+ </details>