DeepSeek Harness plugin

dsh-matlab

DeepSeek Harness plugin: matlab.run tool — run MATLAB code via matlab -batch and return output plus saved figures.

Jump to install

Source facts

Repository
weijianguizhou/dsh-matlab
Latest update
Aug 20, 2026
Category
Tools & Capabilities
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/weijianguizhou/dsh-matlab
Plugin: dsh-matlab
Author: weijianguizhou

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-matlab

DSH(DeepSeek Harness)插件:给 Agent 提供 matlab.run 工具——直接跑 MATLAB 代码并返回输出和图片。

特性

  • matlab.run 工具:传 MATLAB 代码 → 写入临时 .m 脚本 → matlab -batch 执行 → 返回 stdout/stderr。
  • 自动存图:代码产生的所有 figure 自动保存为 PNG,返回文件路径(存于工作区 .dsh-matlab/figures/)。
  • 安全审批:MATLAB 可执行任意代码,默认每次调用前请求用户批准(可关闭)。
  • 本地执行:跑在你本机的 MATLAB 上(路径可在插件配置里改)。
  • 零侵入:纯 host 工具插件,不修改任何官方代码。

安装

在目标 profile 中作为 link 依赖安装并加入 bundle 层:

dsh plugin --profile desktop add link:/path/to/dsh-matlab

或在 profiles/<name>/package.json 手动加入依赖,并确保它出现在 dsh.profile.bundles 列表中。装完重启 DSH Desktop 即生效。

配置

插件行可带 config(示例,加在你的 profile 的组合配置里):

- id: matlab
  name: dsh-matlab
  config:
    matlabPath: "D:\\Program Files\\MATLAB 2025\\bin\\matlab.exe"   # MATLAB 可执行文件
    timeoutMs: 120000
    requireApproval: true

不配置则用默认值(检测到的本机 MATLAB 路径)。

开发构建

npm install   # 安装运行时依赖
npm run check # 语法检查

工作原理

1. matlab.run 接收 code(MATLAB 代码)和可选 workdir。 2. 把代码写到工作区 .dsh-matlab/run-*.m,末尾追加存图代码段。 3. 通过 host 子进程通道执行 matlab -batch "run('...')",捕获 stdout/stderr。 4. 把 .dsh-matlab/figures/ 下的 PNG 列进结果返回给模型。 5. 退出码非 0 时以 MATLAB_RUN_FAILED 报错,错误信息含 MATLAB stderr,模型可据此改代码重试。

目录结构

src/host/index.js  工具定义(defineTool)与审批钩子
cordis.patch.yml   bundle 补丁:插入插件行

License

MIT