本文是人工执行清单:DSH 插件安装/重启属于本会话被自动拒绝的审批动作,不能由 Agent 代装。 自检脚本:
npm run check:lsp-mother(只读,不安装、不改 profile、不重启)。
| 项 | 实测 |
|---|---|
| 正式 profile | <DSH_HOME>\profiles\desktop |
| fang 插件 | 3.4.2(LSP 委托代码在 3.5.0 才落地 → 必须先升级) |
| lsp-provider bundle | 未安装(node_modules\@twinsearth\dsh-fang-lsp 缺失) |
| 语言服务器 | 本机 PATH 无 typescript-language-server;E:\DSH 内无捆绑(E11) |
| 运行中的母体 | 在跑(50895),但自检脚本用 dataDir token 探测返回 401 → 需要生产配置 token |
@twinsearth/fang-dsh-plugin@3.5.0 已发布,可 Plugins 里更新);npm run check:lsp-mother 的 “fang plugin supports LSP delegation” 从 TODO 变 PASS。<repo>\lsp-provider(@twinsearth/dsh-fang-lsp);0.2.2-rc.3 + typescript-language-server@6.1.0 + typescript@5.9.3(版本已在 lsp-provider/LOCKED-VERSIONS.json 锁定);check:lsp-mother 显示 bundle installed、patch rows complete、tls available(或下一步覆盖路径)。bundle patch 会插入 5 行:
fang-lsp-fs-local、fang-lsp-subprocess-local、fang-lsp-seam、fang-lsp-stdio、fang-lsp-tool。
dsh-lsp-stdio 默认按子进程 PATH 解析 typescript-language-server;profile 安装的 .bin 通常不在 PATH。
check:lsp-mother 会直接打印可粘贴片段(用 profile 内真实路径 + 本机 node 绝对路径):
- id: fang-lsp-stdio
config:
servers:
typescript:
command: '<node.exe 绝对路径(`where node`)>'
args:
- '<DSH_HOME>\profiles\desktop\node_modules\typescript-language-server\lib\cli.mjs'
- '--stdio'
extensionToLanguage:
'.ts': typescript
'.tsx': typescriptreact
'.js': javascript
'.jsx': javascriptreact
把该片段追加到 profile 的 cordis.patch.yml(不存在则新建):
<DSH_HOME>\profiles\desktop\cordis.patch.yml
dsh-lsp-stdio 明确 trusts its configured server、无沙箱;委托请求的 workspaceRoot 由调用方传入,
因此母体必须显式登记允许根(空 = 全部拒绝,fail-closed):
- id: fang-orchestrator
config:
contract:
delegate:
lsp:
allowedRoots:
- '<允许的工作区根,例如仓库绝对路径>'
includeForkWorktrees: true
maxLocations: 200
maxResultChars: 20000
说明:fork 工作区根在
includeForkWorktrees: true时由任务 registry 自动登记; 越界根/文件逃逸 →contract-invalid-request,且每次尝试入contract-delegate审计。
npm run check:lsp-mother -- --base <生产URL> --token <生产 token> `
--workspace-root <允许根内的目录> --definition-file <相对文件> --line 0 --character 0
--require-lsp 在缺失时退出非 0):npm run probe:mother -- --base <生产URL> --token <生产 token> --require-lsp `
--workspace-root <允许根内的目录> --definition-file <相对文件> --line 0 --character 0
check:lsp-mother:lsp provider PASS(default=mother、actions=definition,references,implementation,hover)、real definition / real hover PASS;probe:mother:readiness: fang.tool.invoke:lsp=READY,lsp.definition/lsp.hover PASS(返回值是 {path,line,character} 1-based 展示 / {contents})。注意:
allowedRoots必须是显式登记的绝对工作区根;仅当查询对象是 fork 工作区时才可以依赖includeForkWorktrees: true自动登记。母体自身工作区(例如仓库目录)需要显式写进allowedRoots。
@twinsearth/dsh-fang-lsp;cordis.patch.yml 里 fang-lsp-stdio / fang-orchestrator 的覆盖片段;check:lsp-mother 回到 PENDING(bundle missing)即回滚完成。fang.capability.list 无 lsp provider 字段属预期);ctx.lsp 存在但查询报 LSP_UNAVAILABLE,优先检查 stdio 的 command 绝对路径与工作区是否在允许根内。