← 返回列表
未验证
┌──────────────────────┬─┐
尚未跑自动兼容性验证,可查看页面内的依赖与入口分析。 · 最近上游提交 2026/9/17 · 已提供中文文档
DeepSeek Harness Web 插件:一个会话头部拆分按钮,用于从工作区的 package.json 运行 npm 脚本(默认:dev,否则 start,否则第一个声明的脚本)。
综合分
29.1
GitHub 分
29.1
用户评分
—
★ Stars
0
周下载量
—
兼容 / 相关生态插件(非 dsh 原生,请按其对应运行时安装)
git clone https://github.com/albertgranados/dsh-run.git信任档位:已验证本站已于 0 天前真实安装成功
- 是什么
- 生态应用(桌面端 / Web 外壳,不以 dsh plugin add 安装)
- 装得上吗
- 本站已真实安装成功(非静态推断)
- 安全吗
- 本站尚未对该插件做风险分级(暂未覆盖,不等同于无风险)
- 还在维护吗
- 活跃:最近一次提交在 8 天前
档位由下列信号合成:本站实装验证(真实安装,当前最高到 L4)· 验证所用 dsh 版本 · 静态安装检查 · 风险分级 · 仓库维护状态。下方各区块是它的证据明细。 验证判据与等级说明 →
🟢实装验证通过· 2026/9/25
由本站实装验证器在真实 dsh 环境安装成功,非静态推断。
数据截至 2026/9/25(元数据每日更新 · 实装验证按队列轮转,单条结论的验证时间见上方)
依赖的 DSH / Cordis 模块
@deepseek-ai/cordis用户评分
还没有人投票,来当第一个
订阅周报,不错过优质插件更新
每周一封 · 高评分插件 + 新用户活动
README
由 DeepSeek 最新模型翻译生成dsh-run
DeepSeek Harness 插件,它在会话标题栏右上角(Open in… 按钮旁边)添加一个针对所打开项目 npm 脚本的复合按钮。
┌──────────────────────┬─┐
│ ▶ npm run dev │▾│ ← 主按钮运行默认脚本
└──────────────────────┴─┘ ← 箭头展开 package.json 中的全部脚本
English:一个 DeepSeek Harness Web 插件。会话标题栏会长出一个拆分按钮(播放 + 箭头),用于运行工作区 package.json 中的一个脚本:主按钮运行默认脚本(dev,否则 start,否则第一个声明的脚本),箭头会列出并运行每一个脚本,并将其设为新的默认脚本。当工作区没有 package.json 脚本时,它不渲染任何内容;当脚本正在运行时,它会变成停止按钮;当启动进程过早退出时,它会显示失败输出。请参见末尾的 English。
它做什么
- 读取 package.json,来自会话的工作目录(即 cwd)。
- 仅当存在带脚本的 package.json 时才出现。 没有清单文件,或没有
scripts,按钮就不会渲染:连一个空位都不会留下。
- 主按钮:显示播放图标和默认命令
(npm run dev)。点击后运行它。运行期间,图标变为
停止,再次点击会停止进程(整个进程组:
npm → sh → 服务器)。
- 下拉菜单:将所有声明的脚本列为 npm run 。
选择其中一个后,它会运行,并成为播放按钮的新默认脚本。该选择会按项目在浏览器中记住
(localStorage,键为 dsh-run.defaults)。
- 自动默认:dev;如果不存在,则为 start;如果也不存在,则为
清单中的第一个脚本。
- 可见的失败:如果脚本在前 30 秒内以非零代码退出,
按钮会变为红色,tooltip 会带上其输出的最后一行。已在运行的脚本不会因双击而重新启动:该请求
会复用仍在运行的执行。
宿主路由
| 路由 | 它做什么 |
| --- | --- |
| GET /dsh-run/scripts?cwd= | 该项目的 package.json 脚本、自动默认脚本以及执行表。 |
| POST /dsh-run/run | { cwd, script } → 在该目录中执行 npm run 。 |
| POST /dsh-run/stop | { cwd, script } → 终止该执行的进程组。 |
| GET /dsh-run/log?cwd=&script=&bytes= | 某次执行已收集的输出尾部(stdout/stderr)。 |
它们都会先经过 harness 的信任过滤器
(connection.requestRejection):与其余 API 相同的 Host/Origin 边界和相同的会话
cookie。此外,每个带请求体的路由都会在边界处验证 JSON,并在宿主中重新解析项目:目录必须是绝对路径且存在,并且请求的脚本必须在其自身的
package.json 中声明。
进程通过 harness 的 subprocess 服务启动,因此
terminate() 会波及整个进程组,退出后输出仍然可读,并且卸载插件会停止它自己启动的东西。
安装
从 GitHub(公开)
dsh plugin --profile web add github:albertgranados/dsh-run
或从本地检出(保持链接:编辑后重启)
dsh plugin --profile web add /ruta/a/dsh-run
然后重启 harness
该包声明了 dsh.bundle.patch,因此 dsh plugin 本身会自行协调 dsh.profile.bundles:无需手动编辑 package.json 或 cordis.patch.yml。没有构建步骤:lib/index.js 和 lib/client.js 在仓库中是手工编译的(客户端以原始形式提供给浏览器,不经过任何打包器)。
重启后,重新加载浏览器页面(http://127.0.0.1:3080)。该按钮只会在工作区包含 package.json 的会话中出现。
卸载
dsh plugin --profile web remove dsh-run
快速验证
插件行是否在配置文件树中?
dsh --profile web --dump-config | grep -A2 dsh-run
在 harness 运行时(路由需要浏览器 cookie)
curl -s "http://127.0.0.1:3080/dsh-run/scripts?cwd=$PWD" | head
说明
- 命令始终是 npm run ;npm 通过 harness 其余部分使用的同一执行环境解析(subprocess.resolveExecutable)。
- 环境变量:子进程启动时使用 harness 自身已清理过的环境(不含凭据和 DSH_),外加 FORCE_COLOR=0 / NO_COLOR=1,以免日志带有 ANSI 转义序列。
- 限制:最多 8 个并发执行,每个流在内存中最多 32 KiB 队列,每次执行在磁盘上最多 4 MiB 的溢出*(日志的完整路径会出现在 /dsh-run/log 的响应头中)。
English
A DeepSeek Harness web plugin: a Session-header split button for the workspace's
npm scripts.
- Main button (play icon + the default command, e.g. npm run dev) runs the
default script — dev, else start, else the first one declared. While a run
is alive it turns into a stop button, and a second click terminates the whole
npm process group (npm → sh → the dev server).
- Chevron lists every script in package.json as npm run .
Picking one runs it and makes it the new default for that workspace, remembered
in the browser (localStorage, key dsh-run.defaults).
- Renders nothing when the workspace has no package.json scripts, or before
the host answers.
- An early non-zero exit paints the button red and the tooltip carries the last
line of that run's output; the dress clears after 8 seconds.
Install:
dsh plugin --profile web add github:albertgranados/dsh-run
restart the harness, then reload the browser page
Host routes (all behind the harness's Host/Origin fence and login cookie):
| Route | Purpose |
| --- | --- |
| GET /dsh-run/scripts?cwd= | Scripts, auto-picked default, live run table. |
| POST /dsh-run/run | { cwd, script } → npm run 。 |
| POST /dsh-run/stop | { cwd, script } → 终止该运行的进程组。 |
| GET /dsh-run/log?cwd=&script=&bytes= | 收集的 stdout/stderr 尾部内容。 |
MIT 许可。