Martlet-Tech/dsh-open-folder-fix ↗★ 0

@local/dsh-open-folder-fix

Host fix for the Windows workspace-open action: open the workspace directory with explorer.exe /e,<dir>, because the shipped explorer.exe <file:// URI> invocation reports success without raising a window on some hosts 适合在Windows上遇到无法通过资源管理器打开DSH工作区目录的系统用户。

Package
@local/dsh-open-folder-fix
Compatibility
Unverified
Version
1.0.0
License
MIT
Last updated
Sep 24, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Martlet-Tech/dsh-open-folder-fix

配置

launchWatchMs(默认 1500):explorer.exe 交接的早期失败观察窗口。 启动成功与否不与进程退出绑定——Explorer 把请求交给正在运行的 shell 后就退出, 所以只有 spawn 错误(如 ENOENT)才算失败。

Config 必须导出 Standard Schema

这是本项目踩过的坑,改 Config 前务必读完。

cordis 的 resolveConfig 只要发现插件导出了 Config,就无条件读 Config['~standard'].validate(config):

// @deepseek-ai/cordis  lib/index.js
function resolveConfig(runtime, config) {
  if (!runtime.Config) return config
  const result = runtime.Config['~standard'].validate(config)  // ← 无保护的属性读取
  ...
}

因此 Config 必须是符合 Standard Schema 的对象 (含 ~standard.validate)。如果写成看起来更自然的样子:

// ✗ 错误:会让整个 dsh 起不来
export const Config = {
  launchWatchMs: { type: 'number', min: 1, max: 600000, default: 1500 },
}

普通对象没有 ~standard,上面那行读出 undefined,紧接着 .validate(...) 抛 TypeError。这个异常发生在组合树启动阶段,结果是整个 dsh 无法启动, 而不只是本插件失效——排查时会以为坏的是别处。

正确写法见 index.js 的 Config:自带 validate,负责填默认值、 校验范围,并返回 { value } 或 { issues }。