Repository navigation
refactor: 复用内置查看器与 workspaceFiles,只保留保存端点 - #6
Merged
Merged
Conversation
文件默认交还 dsh 内置查看器,插件不再自动认领资源。正文经 dsh-resource://file/session 地址调 remote.workspaceFiles.readBytes 读取,文件树与 tab 复用内置能力,删掉自建的 describe、listDir、readFile 三个端点、覆盖层面板与文件树。UI 只留两个席位:内置文档预览头部的铅笔图标,以及 sidebar.right.pane.tab 上按类型 id 注册的 Monaco 正文。 写入仍走自注册的 /classic-coding writeFile,改用 Node 原生 fs.writeFile,不经 ctx.fs 的 agent 沙箱。 同时修三处接线错误:replaceTab 传布尔值让布局层抛 layout: tab true has no pane,改为传活动 tab 的 id;inject 缺 remote.workspaceFiles,正文一读文件就崩在 without inject;readBytes 返回的 RemoteResult 没解包,编辑器拿到空内容且完全不报错。 版本升到 0.2.3,README 同步新交互,release workflow 把 Smoke 挪到 Build 之后,冒烟脚本的 inject 期望一并更新。
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.
refactor: 复用内置查看器与 workspaceFiles,只保留保存端点
背景
旧版在 DSH 右侧滑出一个自建的覆盖层面板,带自己的文件树与
describe/listDir/readFile三个 RPC 端点,资源由插件自动认领。dsh 0.1.7-rc.2 的右侧栏已经提供 tab 类型注册表与文档动作席位,内置@deepseek-ai/dsh-api-workspace-files也提供文件读取,再自建一套属于重复实现。改动
dsh-resource://file/session/<会话>/<路径>地址调remote.workspaceFiles.readBytes读取内容describe/listDir/readFile三个端点sidebar.right.tab.document.actions,Monaco 正文按类型 id 注册到sidebar.right.pane.tab/classic-codingwriteFile端点,改用 Node 原生fs.writeFile,不经ctx.fs的 agent 沙箱replaceTab传布尔值导致布局层抛layout: tab true has no pane、inject缺remote.workspaceFiles导致正文一读文件就崩、readBytes返回的RemoteResult未解包导致编辑器空白且不报错验证
pnpm typecheck通过pnpm build通过,产物为lib/index.js、lib/index.d.ts、lib/client.js与lib/client.js.mappnpm smoke全部通过ok,文件确实落盘行为变化
files类型docs/screenshots下三张图录制于旧面板时期,暂留在仓库里未清