DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

weijianguizhou /

weijianguizhou/dsh-matlab

Verified

This plugin has no description yet.

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@e0ed814b

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

—/ 5

No ratings yet

Verified DSH bundle

Commit e0ed814b3b41

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout