Skip to content

docs(remote-access): 远程接入协议与 Web 客户端提案(关联 #116、#95) - #128

Closed
Paraso42 wants to merge 4 commits into
ECNU:mainfrom
Paraso42:docs/remote-access-proposal
Closed

Paraso42 wants to merge 4 commits into
ECNU:mainfrom
Paraso42:docs/remote-access-proposal

Conversation

@Paraso42

@Paraso42 Paraso42 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

问题与修改

关联 #116(开放远程接入协议与 Web 客户端)与路线图 #95 的「远程连接」方向。

新增公版远程接入方向的提案文档,全部为新增文件,不改动任何既有代码或配置。
按 #116 的「建议第一步」,先提交社区方案对比与最小原型设计,确定方案后再动手实现。

  • docs: add remote access protocol proposal:新增 docs/proposals/remote-access/(中文 README.md + 英文 README_EN.md,互为语言切换),覆盖 [Feature] 开放远程接入协议与 Web 客户端 #116 要求的全部四项:
    • 复用范围:逐条核验本机实装 DSH 0.2.0-rc.2 的连接层能力,区分「直接复用 / 适配包装 / 必须新建」;
    • 社区方案对比:官方连接层与 [Feature] 开放远程接入协议与 Web 客户端 #116 列出的四个社区项目,按分层、认证、是否补丁内核、断线恢复等轴对比;
    • 协议边界:eduwork-remote/v1 的握手、版本与能力协商、数据面帧复用、幂等与恢复语义;
    • 部署方式:四级形态(同 LAN / 已有 VPN / 自建反代 / 信令与数据分离),并给出中继的硬性约束;
    • 维护成本:零内核补丁、零新增依赖、零新增 npm 包;中继为可选组件。
  • docs(remote-access): state public-edition independence requirements:显式对应 CONTRIBUTING.md 对公版的三项硬要求——不依赖机构凭据、不依赖私有网络、不依赖相邻源码仓库。

提案的关键结论:DSH 连接层已经把「浏览器 ↔ Host」做完了,本方向不应新造协议栈,
而应给已有的 Connection 载体层增加一个可远程承载的实现。

验证

node scripts/check-source-docs.mjs 通过,实际输出:

{ "files": 270, "links": 765, "readmePairs": 38, "broken": [], "readmeIssues": [] }

文档中的复用结论来自本机实装包的 README 与类型声明,路径已写在文中,可逐条复核。
涉及未核实内容处已显式标注「推断」「待验证」与「核验声明」,未将未验证内容写成已实现。

未验证范围:

  • 社区项目的源码级核验尚未完成(已完成的只有仓库级元数据,见提案中的核验小节);
  • 协议与插件均未实现,提案不代表可用功能,也不含可直接使用的配置;
  • 涉及界面时需附演示截图——本 PR 无界面改动,故无截图。

兼容性与后续事项

本 PR 只新增文档,不修改现有插件的公开导出、配置标识与数据路径,不改依赖锁,
不新增运行时依赖,不新增需单独发布的 npm 包。发行清单无改动,无历史数据迁移。

唯一需要评审的公开接口是提案中的 eduwork-remote/v1 握手与授权范围词汇。

提案里列了 8 项「尚待明确」,其中信任边界的取法是分岔口:本文取纯外围路线
(传输层围栏 + 装配清单,零内核补丁),若维护者希望 DSH 上游提供多 Peer / 设备身份的一等能力,
方案需要改写成上游提案。在这一点确认前不进入实现阶段。

实现、合并、npm 发布与桌面发行分别处理。

Add docs/proposals/remote-access/ (README.md + README_EN.md) proposing an
open remote access protocol and web client for EduWork.

Related: ECNU#116, ECNU#95. Documents only; no code and no configuration change.

Covers: verified reuse surface of the DSH connection layer, the Peer contract,
community solution comparison, host/relay/client responsibilities, the
eduwork-remote/v1 handshake and scope vocabulary, device pairing and
revocation, idempotency and recovery, deployment levels, maintenance cost,
compatibility boundary and acceptance mapping.
Make the CONTRIBUTING.md requirement on the public edition explicit: the
generic plugin must not depend on institution credentials, a private network
or an adjacent source repository. Records how this proposal satisfies each
item, and that user-owned infrastructure is a deployment choice rather than a
product dependency.
…ection

Revise the proposal along the five directions confirmed in review on
2026-10-09, and fold in source-level verification of all four community
projects.

Direction changes:

- Replace the scope vocabulary with an operation-surface split. Phase 1 does
  not introduce roles, and host management (pairing, credential handling)
  becomes a separate surface that stays closed by default.
- Split device credentials into four kinds: relay access key, one-time pairing
  invitation, long-lived device credential and session key. The invitation
  becomes single-use, and reconnecting proves identity instead of re-scanning.
- Require revocation to tear down established connections rather than only
  refuse new requests, and record the upstream semantics behind that: existing
  requests continue when a listener refuses subsequent requests.
- Promote end-to-end encryption to a hard requirement, and give the handshake
  two layers: Noise IK for the channel, then the application negotiation.
  Record that a relay access key authorizes relay use only and can never stand
  in for device pairing.
- State that the relay Server may be maintained in its own repository.

Verification:

- All four community projects are now source-verified at pinned commits, with
  file and line evidence. None can be reused directly: one keeps its trust root
  on the relay and has no local confirmation, two have no business encryption,
  and two have no device identity at all.
- Record that the official web profile enables gzip, so injecting into a
  proxied response corrupts the body. The client therefore takes the official
  index from loopback and injects server-side instead of rewriting responses in
  the proxy path.

Also relax the reuse stance from "implement everything ourselves" to "reuse
first, implement only what cannot be reused"; add the question of whether the
plugin belongs in packages/ or dsh-plugins/, with the tradeoff recorded; and
tighten the compatibility boundary so it no longer contradicts the plugin's
independence requirement.

Documents only; no code and no configuration change.

Related: ECNU#116, ECNU#95.
The reuse table pointed at the next two sections, but the proposal now carries
three verification sections. Point at the verification sections without
counting them, so the reference cannot go stale again.

Documents only; no code and no configuration change.

Related: ECNU#116.
@freedomkk-qfeng

Copy link
Copy Markdown
Member

谢谢前期的梳理,我们确认按下面的方向先做一个可运行原型:

  1. 面向其他终端,通过 URL 访问。 可以是另一台电脑、手机或平板,使用浏览器打开 URL 即可;手机扫码只是打开该 URL 的便捷入口,不将功能限定为手机远控。
  2. 配对后沿用原有 Agent、会话和工作区权限。 原来需要用户审批的操作仍然需要审批,但用户应当能直接在已配对的远端终端上确认或拒绝,也能回答 Agent 的提问,无需再回到本机确认。配对不等于自动开启 full access;设备配对与凭据管理仍与这些日常操作分开,首版保留在本机处理。
  3. 独立 DSH 插件 + Web 客户端 + 可自托管的中继 Server。 插件源码按独立插件放在 packages/,应能用于官方 DSH 和 EduWork,允许独立 npm 包;Server 如有需要可以另建仓库。中继接入 Key、端到端加密、本机配对和逐设备撤销继续按此前确认的方向实现。
  4. 优先复用官方界面、连接能力、社区实现和成熟依赖。 降低维护成本是目标,“零新依赖、零新 npm 包”不作为硬约束;遇到官方接口的具体缺口再一起讨论。

首版先集中跑通通过中继连接本机 Agent 的流程:在其他终端打开 URL、完成配对、查看并继续任务、处理授权与提问、查看成果。原型同时验证设备撤销和断线重连。先不要求把 LAN、VPN、反向代理等全部部署方式一起做齐。

具体协议字段和实现细节可以在原型验证中逐步收敛,不必等整份协议完全定稿才开始。你的服务器可以用于中继服务的验证;也请同步更新提案正文和 PR 说明里仍然保留的旧限制。后续结合原型结果继续讨论。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants