Repository navigation
feat(tui): 为 dsh-remote 增加 dsh-tui 界面(设置页 / 工作区 provider / 工作区清理) - #92
Merged
Merged
Conversation
baiseraku
marked this pull request as ready for review
November 4, 2026 17:20
Adds a terminal adaptation layer that registers through dsh-tui's plugin seams (ctx.tuiScenes / ctx.tuiWorkspaces / ctx.tuiStatus / ctx.commands) without patching dsh-tui itself: - /dsh-remote full-screen scene: machine list, add/edit form, connect/probe/ browse, use-as-workspace, and a workspace-cleanup page. - workspace provider (dshremote://): lists existing mirrors, the current machine workspace and (optionally) each machine's recent projects; resolves URIs back into local mirror dirs; describe() stays local-only. - in-process host API ctx.dshRemote (apiVersion 1) shaped as pure data with semantic error codes; secrets never leave the host. - workspace cleanup: permanently delete a remote workspace (its chats, the workspace registration, the recent/current path so the provider cannot recreate it, and the local mirror) or only its chats; busy sessions are detected via the sessions service plus a POSIX flock probe and refused. - docs/tui.md (contract + behaviour + limits), README zh/en sections, i18n zh/en, and tests for the host API, provider, scene rendering/keymaps and the cleanup path rules. TUI files are untouched; lib/tui is lazy-loaded so a Web/Desktop profile keeps working even if the directory is absent.
… stale version refs Maintainer review pass on the rebase: - provider.refresh() now ensures mirrors with register:false — merely opening the /workspace picker must not write the user's global workspace registry; registration happens in resolve()/resolvePath() when a target is actually picked. (Two refresh tests re-pinned accordingly.) - new test/tui-flow.test.js drives runDialogFlow through scripted dialog answers: connect/Esc/decline/validation-error branches and the add-machine wizard for all three auth modes. lib/tui/flow.js 33% -> 100% lines, clearing the 60% per-file coverage gate the CI test leg enforced. - check.mjs / sync.sh: the '0.8.73' reference predates the release numbering; 0.8.73 shipped as the remote-shell fix, so the comment now just says 'the TUI integration'.
flymysql
force-pushed
the
feat/dsh-tui-integration
branch
from
November 6, 2026 12:34
5252303 to
3f70e5d
Compare
Owner
|
感谢这份高质量的 PR——契约文档、错误码设计、安全边界(realpath + 恰好两层 + meta 标记 + WORKSPACE_BUSY 占用拒绝)都做得很扎实。我已经把它推进到可合状态,几处需要你知悉: 前提核实: 我直接推到本分支的修改(rebase 到最新 main + 三处评审修正,你的原始提交完整保留):
关于拆 PR:不用拆了。TUI 基础层和工作区清理在同一个用户旅程里(清理页就从场景里进),拆开反而各自不完整;CONTRIBUTING 那条主要是防「顺手捎带无关改动」,你这个是一个逻辑改动。 遗留观察(不阻塞):
CI 绿了就 squash 合入(保持你的作者归属)。 |
flymysql
pushed a commit
that referenced
this pull request
Nov 7, 2026
…sue #93) The picker's position:fixed overlay rendered inline in the slot's React subtree, where the 0.2.2 conversation container traps pointer events — the dialog painted but every click fell through to the chat text in existing sessions (the hero page has no such container, hence 'new session works'). The host's own Modal/Menu portal to body; now the picker does ReactDOM.createPortal(overlay, document.body) too, with the inline overlay kept as the fallback when react-dom is absent from the shared module map. Our context menu already used this technique. Also ships the dsh-tui adaptation layer from PR #92 (@baiseraku): /dsh-remote scene, dshremote:// workspace provider, workspace cleanup page. Tests: issue93 portal-vs-fallback pair (2), full suite 1028, check.mjs clean, coverage gates green.
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
给 dsh-remote 增加一层 dsh-tui 适配层:在终端里也能用同一份机器清单、SSH 池和远程工作区,不修改 dsh-tui 本体(全部通过它的插件接缝注册)。
主要能力:
/dsh-remote全屏设置页:机器列表 / 新增编辑表单 / 连接、探测、浏览远端目录 / 设为工作区dshremote://):/workspace选择器里直接列出远程项目;支持/workspace open dshremote://<机器>/<远端路径>与启动参数/dsh-remote→ 机器菜单 →m):d彻底删除工作区:对话 → 工作区登记 → 每台机器的「最近工作区 / 当前工作区」→ 本地镜像目录($DSH_HOME/remote-workspaces/<host>-<user>-<port>/<name>)x只删该工作区下的对话(保留镜像与登记)r只把远端路径移出最近列表(不删镜像)d会被拒绝,并提示先停止(进程内sessions服务 + POSIXsession.lock的 flock 探测)recentWorkspaces/machine.workspace,否则 provider 下次启动会按最近列表把镜像重建回来(这就是「删了又出现」的根因)改动
lib/host-api.js:ctx.dshRemote(apiVersion 1)在原有方法上新增listWorkspaceMirrors/deleteWorkspaceSessions/deleteRemoteWorkspace/forgetWorkspaceRecent,新错误码WORKSPACE_BUSYlib/workspace-cleanup.js:镜像安全校验(realpath、恰好两层、.dsh-remote-meta.json)+ DSH 会话目录编码(projectKey/encodeSegment,与@deepseek-ai/dsh-session-persistence-jsonl一致)+ 扫描/删除lib/index.js:isSessionLive/forgetRemotePath接线;TUI 层 lazy import,Web/Desktop profile 不受影响lib/tui/:场景、provider、i18n(中/英)、格式化docs/tui.md:契约、cwd 语义、清理安全边界、限制;README.md/README.en.md增加 TUI 章节test/tui-*.test.js、test/workspace-cleanup.test.js、test/host-api.test.js新增 cleanup 覆盖验证
npm test:997 例,988 通过 / 9 skip / 0 failnode check.mjs:通过/dsh-remote打开、菜单m、d/x/r三条删除路径、占用中删除被拒绝并提示;Esc/←/→ 层级导航正常兼容性 / 限制
ctx.tuiWorkspaces不在 dsh-tui 的「冻结接缝」列表里,属于实验面;provider 不可用时设置页仍可用lsof,只能依赖进程内检查(文档已注明)apiVersion仍为1:新增方法属于向后兼容的扩展;如果希望升版本请指出关于 PR 大小
按 CONTRIBUTING「一个 PR 一个逻辑改动 / 重大改动先开 issue」的建议:这个 PR 确实偏大(整个 TUI 适配层 + 清理功能一起)。如果更希望拆成「TUI 基础层」和「工作区清理」两个 PR,或先开 issue 讨论设计,我可以按你的偏好调整。已转为 Ready for review;CI 首次运行需要维护者批准 workflow 后才会执行。