dsh-plugin-restart
v0.4.1
工具与效率
可执行外部程序以 shell 执行命令写入文件
安全、分离式的 DSH 进程重启命令(`/restart`、`/dsh-restart`)与 agent 工具(`dsh_restart`),并带有原生 Web UI 候选样式。
作者原文(英文)
Schedule a detached DSH restart from inside DSH via /dsh-restart command or dsh_restart agent tool
中文简介由 DeepSeek 模型翻译,仅供参考。
检测报告
关注度高。命中了不少能力模式,其中可能有需要留意的。逐条看下面的清单。
2高关注3需留意3一般16未命中
高关注需留意一般
能力清单
- 可执行外部程序
spawns-processes高关注3 处命中…ipts/dsh-restart-error-server.js:27import { spawn } from "node:child_process";lib/index.js:1import { spawn } from "node:child_process";lib/index.js:5import { execFileSync } from "node:child_process";- 看它调用哪些程序。调用本机已有的工具是常见做法。
- 以 shell 执行命令
shell-exec高关注1 处命中lib/index.js:56execFileSync("/bin/bash", ["-c", launch], { stdio: "ignore" });- 看命令字符串是拼出来的还是写死的。拼接用户输入才是真正的风险。
- 写入文件
writes-files需留意3 处命中…ipts/dsh-restart-error-server.js:273writeFileSync(configPath, `${JSON.stringify(config, null, 2)}\n`);lib/index.js:41mkdirSync(dshHome, { recursive: true });lib/index.js:42writeFileSync(helperPath, helper, { mode: 0o700 });- 看写入位置。写自己的配置目录是正常的,写系统目录不是。
- 启动伪终端
spawns-pty需留意2 处命中…ipts/dsh-restart-error-server.js:289const child = spawn("/bin/bash", [config.scriptPath, ...RESTART_ARGS], {lib/index.js:56execFileSync("/bin/bash", ["-c", launch], { stdio: "ignore" });- 伪终端等于给了一个完整 shell。确认这是插件的核心功能。
- 发起网络请求
network需留意1 处命中…ipts/dsh-restart-error-server.js:234fetch('/', { cache: 'no-store' }).then(function () {- 看请求发往哪些域名。发往作者自己的后端是常见做法。
- 读取文件
reads-files一般5 处命中…ipts/dsh-restart-error-server.js:47return JSON.parse(readFileSync(configPath, "utf8"));…ipts/dsh-restart-error-server.js:74stat = statSync(path);…ipts/dsh-restart-error-server.js:80text = readFileSync(path, "utf8");lib/index.js:75if (Date.now() - statSync(path).mtimeMs > FAILURE_NOTICE_MAX_AGE_MS) return "";- 读文件是绝大多数插件的正常工作方式,本身不构成顾虑。
- 读取环境变量
reads-env一般3 处命中…ipts/dsh-restart-error-server.js:282const env = { ...process.env };lib/index.js:25return process.env.DSH_HOME || join(homedir(), ".dsh");lib/index.js:48if (process.env.DSH_RESTART_DRY_RUN === "1") {- 环境变量里常混有密钥。看它是否把整个 env 都读走。
- 动态加载模块
dynamic-import一般1 处命中lib/types/index.d.ts:3export declare function apply(ctx: import("@deepseek-ai/cordis").Context): void;- 动态导入本身无害,但会让依赖关系难以静态审阅。
逐条扫描明细
| 能力 | 标识 | 关注度 | 命中次数 |
|---|---|---|---|
| 可执行外部程序 | spawns-processes | 高关注 | 3 |
| 以 shell 执行命令 | shell-exec | 高关注 | 1 |
| 写入文件 | writes-files | 需留意 | 3 |
| 启动伪终端 | spawns-pty | 需留意 | 2 |
| 发起网络请求 | network | 需留意 | 1 |
| 读取文件 | reads-files | 一般 | 5 |
| 读取环境变量 | reads-env | 一般 | 3 |
| 动态加载模块 | dynamic-import | 一般 | 1 |
这份报告的口径
扫描读的是包里的源码,全程不执行第三方代码。 本次读了 10 个文件,扫描于 2026-10-14。 命中次数只说明源码里出现过这类调用,不说明行为好坏——一个插件读写文件 500 次和 1 次 都会被记为「读取文件」。这是能力清单,不是信任评分,也不是安全结论: 没扫出来的能力可能只是写法没被规则覆盖。
依赖安全公告
已查询这个插件声明的全部依赖,没有匹配到已公开的安全公告。(含 DSH 框架包在内的 @deepseek-ai/* 不作查询——那是运行时自己的问题,不是插件的。)