
hyrinx/dsh-plugin-open-with
dsh-plugin-open-with
dsh-plugin-open-with is a community DeepSeek Harness plugin. Read the repository README before installing.
Install
npx @deepseek-ai/dsh plugin --profile web add github:hyrinx/dsh-plugin-open-withRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/dsh-plugin-open-with)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from hyrinx/dsh-plugin-open-with, cleaned of badges and images.
<h1>dsh-plugin-open-with</h1>
<strong>打开方式 · 胶囊拆分按钮</strong><br />
在 DeepSeek Harness Web 会话头部添加胶囊拆分按钮,一键在当前工作区打开 VS Code、终端和文件资源管理器。
<a href="#screenshot">效果图</a> ·
<a href="#features">功能</a> ·
<a href="#install">安装</a> ·
<a href="#security-model">安全模型</a> ·
<a href="#known-limitations">已知限制</a> ·
<a href="#build-and-extend">构建与扩展</a> ·
<a href="#contributing">贡献</a> ·
<a href="#license">License</a>
Capsule split-button in the dsh web conversation header: open the workspace in VS Code, terminal, or file explorer — extensible to more launchers.
🖼 效果图 <a name="screenshot"></a> <span lang="en">Screenshot</span>
🧩 功能 <a name="features"></a> <span lang="en">Features</span>
- 💊 胶囊拆分按钮:左半边执行当前选择的启动器(默认 VS Code,显示对应的图标与标签,如「打开 VS Code」);右半边下拉菜单列出全部三个启动器,点击菜单项即切换并立即启动。固定 hover tooltip 为「在 VS Code、终端或文件管理器中打开工作区」,不随启动器切换。
- 🛠 三个内置启动器(均通过 DSH
subprocess服务在宿主端启动):- 打开 VS Code:调用
ctx.subprocess.resolveExecutable('code')解析 PATH 上的 VS Code CLI,随后把工作区路径作为唯一参数传给它。Windows 下因 Node 无法直接 spawn.CMD文件,结果会被cmd /c包裹一次;macOS / Linux 直接 spawn 返回的可执行文件。 - 打开终端:按平台选择 shell:Windows 用
cmd.exe并通过start "cmdPath" cmd /K "title X && cd /d <cwd>"开一个独立的新控制台窗口(不会继承 dsh 宿主的 console);macOS 按$SHELL选zsh/bash;Linux 用$SHELL或回退bash。 - 打开文件夹:Windows 调
explorer.exe <cwd>,macOS 调/usr/bin/open <cwd>,Linux 调xdg-open <cwd>。
- 打开 VS Code:调用
- 🌍 中英双语 UI:按钮标签、下拉菜单、hover tooltip、ARIA 标签都内置
zh/en两套字典,通过ctx.locale.register('openWith', { zh, en })注册,跟随 DSH 客户端全局 locale 自动切换。 - 🧱 可扩展:新增启动器要改三处——宿主
src/index.ts的buildSpawnSpec()switch 加一个case,同时在浏览器端TARGETS常量、TARGET_META映射,以及src/client/locales.ts字典里各加一条。目前没有开放的运行时 SPI,扩展需要 fork/改本插件源码。 - 📦 薄宿主 + 薄浏览器端:浏览器端只在
conversation.session.header.actions插槽注入一个按钮组件;宿主端只注册/open-with一个 RPC 通道,含两个 endpoint——launch(cwd, target)负责 spawn,log(level, message, extra)负责把浏览器侧 console 行转发到宿主的日志文件。其余全部走 DSH 既有的subprocess、connection、locale、sessions、slots五个依赖服务。 - 🎨 系统原生图标:按钮与菜单项使用系统提取的原生 PNG 图标,视觉与任务栏 / 开始菜单保持一致。
- 🔒 仅回环浏览器可用:
/open-withRPC 通道在 DSH 连接层以{ authority: 'loopback' }注册,非本机回环访问直接被网关拦截;浏览器端同时也只接受会话列表 snapshot 里真实存在的工作区路径,缺失则静默记录日志、不发起 spawn。
🚀 安装 <a name="install"></a> <span lang="en">Install</span>
方式一:从 npm 安装(推荐)<span lang="en">Install from npm (recommended)</span>
已发布到 npm:dsh-plugin-open-with(当前远端最新 0.1.1)。在终端执行(--profile 必须放在 plugin 子命令之前,否则 dsh 会因为拿不到 profile 名而报错):
# 安装
dsh --profile web plugin add dsh-plugin-open-with
# 验证安装版本
dsh --profile web plugin list
# 卸载
dsh --profile web plugin remove dsh-plugin-open-with
方式二:从仓库安装(开发 / 调试)<span lang="en">Install from repository (dev/debug)</span>
git clone https://github.com/hyrinx/dsh-plugin-open-with.git
cd dsh-plugin-open-with
npm install
npm run build
# PowerShell(Windows):
dsh --profile web plugin add "link:$($PWD.Path)"
# macOS / Linux(bash/zsh):
# dsh --profile web plugin add "link:$(pwd)"
重启 dsh web 生效。后续改源码只要重新 npm run build + 刷新浏览器(改 cordis.patch.yml 需重启 dsh web)。本地源码安装模式下日志写在 <项目根>/logs/host-YYYY-MM-DD.log,npm 安装模式下写在 ~/.dsh/logs/dsh-plugin-open-with/host-YYYY-MM-DD.log。
🔒 安全模型 <a name="security-model"></a> <span lang="en">Security Model</span>
本插件会在 DSH 宿主端启动外部程序,因此依赖 DSH 核心层的三道围栏 + 自身一层枚举保护:
…


