DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
M

dsh-matlab-runner

Matlab Runner

DeepSeek Harness 侧边栏中的 MATLAB:类似 VS Code 的 .m 编辑器,配备持久化 MATLAB 会话(图形确实可以打开)、支持额外挂载文件夹的文件树、实时工作区变量、.mlx 预览,以及面向代理的 matlab_run 工具。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:seally-web/dsh-matlab-runner#5212ddbe3487249a83ea95ea4f0e65789171d5e8
README兼容性版本
Settings

兼容性与来源证明

Matlab Runner 以 dsh-matlab-runner 发布,当前版本为 0.2.2。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/10/30

版本

0.2.2stable
2026/10/30

相关插件

正在加载相关插件…

最新版
0.2.2
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
GitHub
★ 1
周下载
0
最近提交
2026/10/30
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 developer-tools 分类下经过校验的插件。

Web App@deepseek-ai/dsh-web-appdsh 浏览器界面捆绑包:位于 dsh-base 之上的 Web 补丁层,加上运行时粘合插件(提供前端 dist、Web 界面提示符、bash 运行时变量和 URL 行)Sdk App@deepseek-ai/dsh-sdk-appdsh SDK 配置包:基于 dsh-base 提供 stdio JSON-RPC 服务和进程生命周期管理Experimental Inspector@deepseek-ai/dsh-experimental-inspector用于 Host 调试和 Client Runtime 检查的实验性跨 realm CDP hubExperimental Inspector Profile@deepseek-ai/dsh-experimental-inspector-profile用于原始 Session 日志和 Chat 节点检查的可选 Web 捆绑包

README

dsh-matlab-runner

A DeepSeek Harness plugin that puts a VS Code–shaped MATLAB panel in the right sidebar: edit .m code, press ⌘/Ctrl+Enter, watch the console, open figures inline, keep a warm MATLAB session between runs, browse several folders like MATLAB's add-to-path list, and inspect/assign workspace variables.

dsh-matlab-runner is a UI plugin: the host half spawns MATLAB with the system user's permissions (not the agent's sandbox) and the browser half gives you an editor + runner + workspace inspector. Unlike the MCP-based MATLAB plugins, it is not an agent tool wrapper — the agent does get a matlab_run tool, but the panel is the product.

Two halves in one package:

HalfFileWhat it does
Hostlib/index.js, lib/runner.jsOwns the persistent MATLAB session and the run registry, serves /matlab/api/*, and registers the matlab_run agent tool.
Browserlib/client.jsA page-type sidebar tab (editor, gutter, script picker, Run/Stop/Save, live console, figure previews, settings) plus a guide card and the matlab-runner.open shortcut.

The panel

A real run: file tree + variables on the left, editor in the middle, live console below, exported figures as thumbnails. Dividers resize the tree, the variables pane and the console; settings are one click away.

SettingsNarrow sidebar
SettingsNarrow

Two run modes

  • session (default) — one long-lived matlab -nodesktop -nosplash process fed through stdin. After the first boot (≈6–9 s) a run costs ~10–30 ms, the prompt keeps your variables between runs, and figure windows really open on the desktop while the panel also shows the exported PNG. Output is streamed into the console while the script is still running.
  • batch — matlab -batch per run, headless, exits with the script (15–20 s per call, no windows). Kept for CI-ish, leave-nothing-behind work.

The session is shared between the sidebar and the agent tool, so what the model runs and what you type land in the same MATLAB workspace.

Why this runs when the agent's shell cannot

MATLAB needs to write ~/Library/Application Support/MathWorks before it will start. A sandboxed shell (workspace-write) makes matlab -batch exit 1 with an empty console, and a PTY tab owned by the agent is subject to the same sandbox. The host half spawns MATLAB with node:child_process from the host process, i.e. with the system user's permissions, independently of the agent's sandbox mode — so this panel runs MATLAB without switching the session to Full access.

Install

From npm (once published):

dsh plugin --profile web add dsh-matlab-runner

For the desktop app, whose profile is owned by the Electron application, use the bundled script — it copies the payload into the profile, wires the dependency and the dsh.profile.bundles row, seeds the config, and re-composes the plugin:

node bin/install-local.sh        # or: plugins/dsh-matlab-runner/bin/install-local.sh

The official desktop app owns its profile, so the script copies the payload into ~/.dsh/profiles/desktop/node_modules/dsh-matlab-runner, adds the dependency and the dsh.profile.bundles row, seeds the config, and re-composes the plugin's Loader entry.

About that last step: the app watches ~/.dsh/profiles/desktop/package.json, so dropping the bundle row and putting it back reloads the plugin from disk — no app restart, no lost session. bin/reload-host.sh does exactly that:

plugins/dsh-matlab-runner/bin/reload-host.sh   # host half picked up new files

Then reload the page (⌘/Ctrl+R) so the browser half updates too. A full app restart is only needed if the tab still shows the old panel.

Open it

Right sidebar → the add control (+) → the MATLAB 运行器 / MATLAB runner card. After the first visit the tab is in the strip; ⌘/Ctrl+Shift+M opens it from anywhere (web builds: ⌘/Ctrl+Shift+Alt+M).

What the panel does

  • File tree (⌸ 文件) — browse workdir from the panel, expand folders lazily, click any text file to open it in the editor (↑ 上一级 walks up, 刷新 re-reads). Only files with a text extension are editable; anything else reports binary.
  • Editor with a line-number gutter, MATLAB syntax highlighting (keywords, strings, numbers, comments), no autocorrect, Tab = two spaces.
  • Run (⌘/Ctrl+Enter) writes the buffer to <workdir>/.dsh-matlab-runner/<stem>.m and runs it in the persistent session.
  • Script picker — every .m in scriptDir plus every unsaved draft. Picking one loads it into the editor. + New starts a blank buffer, and every buffer is remembered (per file path, plus each draft) so switching files or tabs never throws typed code away.
  • Multiple folders — the tree header has a folder picker plus a + button. + mounts any absolute path (~ works) as an extra tree root, exactly like MATLAB's "add to path" list; mounts are persisted in matlab-runner.json as extraRoots and can be removed again from the same row. Mounted folders are browsable and editable, but a run's working directory still follows the workspace (relative paths stay anchored to the script being run).
  • Variable editor — double-click any row in the variables panel to open the value; edit the literal and 写回工作区 / Write back assigns it with evalin('base', '<name> = <literal>;'), so it really replaces the MATLAB variable (the panel refreshes right after). Numerics are shown with mat2str, anything else through evalc('disp(x)').
  • Stop / ■ aborts the current script (in session mode this restarts the MATLAB session; the next run boots it again).
  • Save writes a real script to <scriptDir>/<name>.m.
  • Console streams stdout/stderr live, then shows exit code, elapsed time, and the script path. Errors print getReport(e,'extended'), so line numbers survive.
  • Autosave — after a run that exits cleanly the buffer is written back to disk: opened files go to their own path, drafts are saved as a new script under scriptDir. Turn it off with the autoSave setting or the Settings checkbox.
  • Drag the dividers — one between the file tree and the editor (width), one between editor and console (height); both are remembered per browser.

Interface

The panel follows the VS Code / MATLAB layout conventions:

AreaWhat it holds
ToolbarThree groups: run (▶ Run / ■ Stop / Save), files (script picker + New), views (file tree / variables). The session badge and the settings gear sit on the right.
BreadcrumbThe folder the panel currently points at, clickable per segment, plus the edit target on the right.
Left columnFile tree on top, MATLAB workspace variables underneath (name / value / class / size), with a drag bar between them and a vertical drag bar against the editor.
EditorGutter, syntax highlighting, splitter above the console — drag it to resize.
ConsoleHeader strip, streaming output, figure thumbnails, and a status bar with phase, exit code, elapsed time and the script path.
SettingsThree labelled sections — run, workspace, MATLAB — as a label/control grid, with the current detection source, "follow this workspace", "pin to this path", Save and Restart session.

Panel toggles (tree / variables) are remembered per browser. node bin/preview-ui.mjs renders the two views to /tmp/mrun-*.html for a quick headless look:

node bin/preview-ui.mjs
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless=new \
  --screenshot=/tmp/panel.png --window-size=980,760 file:///tmp/mrun-panel.html

Saving, drafts and buffers

BufferWhat Save doesWhere it lives
An opened file (picked from the tree or the script picker)Overwrites that file in place — same as the editor's ⌘S. Auto-save (after a clean run) does the same.the file itself
A draft (+ new, name without a path)Saves a copy to <scriptDir>/<name>.m and switches the buffer to that file.<scriptDir> (default <workspace>/matlab)
Unsaved edits of either kindKept in browser localStorage under dsh.matlab-runner.buffers, so switching files or reloading never loses them.browser storage
The script MATLAB actually executesA draft runs from a temporary copy in <workspace>/.dsh-matlab-runner/; an opened file runs in place, so relative paths resolve next to it.workspace

Config

~/.dsh/matlab-runner.json ($DSH_HOME/matlab-runner.json when set), created on first boot with the paths this machine actually uses:

{
  "mode": "session",
  "warmFigures": false,
  "autoSave": true,
  "autoDetect": true,
  "matlabPath": "/path/to/MATLAB/bin/matlab",
  "sessionArgs": ["-nodesktop", "-nosplash"],
  "extraArgs": ["-nodisplay", "-nosplash"],
  "workdir": "~/your-project",
  "scriptDir": "~/your-project/matlab",
  "timeoutMs": 600000,
  "env": {}
}
  • mode — session (persistent, fast, figures open) or batch (one process per run, headless).
  • warmFigures — true initializes the graphics/Java stack during boot, so the first figure costs ~2 s instead of ~13 s; the first run pays that cost up front instead.
  • autoSave — true (default): a successful run writes the buffer back to the open file (or saves a draft as scriptDir/<name>.m).
  • autoDetect — true (default): workdir follows the folder the DSH session has open and scriptDir becomes <workspace>/matlab, so switching projects needs no config edit. false pins the two paths below.
  • matlabPath — the launcher binary (an app bundle's bin/matlab, not the Contents/MacOS payload).
  • sessionArgs — flags after matlabPath for the persistent process.
  • extraArgs — flags before -batch in batch mode.
  • workdir — the session's working directory, and the root scratch scripts are written under. With autoDetect on this is derived, not fixed.
  • scriptDir — where Save puts .m files and where the picker looks (<workspace>/matlab in auto mode).
  • timeoutMs — hard cap per run; Stop is the manual version.
  • env — extra environment variables for MATLAB.

Everything except env is editable in the panel's Settings pane.

Which folder does a script run in?

A buffer that maps to a real file runs that file, so MATLAB's working directory is the file's own folder and readmatrix('data.xlsx') resolves next to the script (same as the editor's Run button). Drafts still run from the scratch copy under <workspace>/.dsh-matlab-runner/, and when MATLAB cannot find a relative path the console shows the base folder:

相对路径以脚本所在目录为基准: /…/W07_quiz(数据文件放这里,或用绝对路径)

Which folder does it use?

The tab sends its session's workspace root with every API call (?cwd=), so:

  1. Session folder wins — the panel always works on what you have open.
  2. Otherwise the first folder in ctx.workspaceRegistry, then the host process cwd (this is what the agent tool sees when no panel is talking).
  3. A report older than 2 minutes is treated as stale, so matlab_run never inherits a folder you closed long ago.
  4. autoDetect: false skips all of the above and uses workdir/scriptDir.

Settings shows the detected root and its source, with 跟随当前工作区 and 固定为当前路径 buttons. Path rejections name the folder you are on, e.g. path outside the configured roots: /etc · 当前工作区: /tmp(面板 → 设置 → 自动检测 / 使用当前工作区).

Agent side

matlab_run({ code | file, name? }) runs one script through the same registry and returns its console text, so the model can iterate on MATLAB code, read the output, and see errors (the wrapper prints getReport(e,'extended')).

Tests

node plugins/dsh-matlab-runner/test/host-unit.mjs     # names, argv, config dialect, path containment, vars helper
node plugins/dsh-matlab-runner/test/client-smoke.mjs  # loader shell + registration order
node plugins/dsh-matlab-runner/test/client-render.mjs # renders the panel body once against stubs
node plugins/dsh-matlab-runner/test/client-tokenize.mjs # highlighter token split (transpose vs string, comments, numbers)
node plugins/dsh-matlab-runner/test/livemd.mjs        # .mlx parser, self-contained fixture
node plugins/dsh-matlab-runner/test/host-apply.mjs    # the whole apply(): routes, tool, tree, vars, session (~40 s)
node plugins/dsh-matlab-runner/test/session.mjs       # real MATLAB: boot, warm reuse, errors, figures, stop (~50 s)
node plugins/dsh-matlab-runner/test/host-run.mjs      # real MATLAB batch path (needs an unsandboxed shell)

bin/check.mjs is the live one: it talks to the running app over loopback (DSH_GUI_URL, default http://127.0.0.1:54501), prints the resolved config, runs a script, proves the session is reused on the next run, and fetches the exported figure through the artifact route. A pass proves the host half is live and MATLAB is reachable; only the page can prove the tab rendered.

The MATLAB tests fail under a sandboxed shell by design — they exercise the same spawn path the app uses, which only exists outside the sandbox.

Limits

  • First figure in a session costs ~13 s (Java/desktop initialization), then ~2 s. Turn on warmFigures to move that cost to boot.
  • Don't name a script after a MATLAB builtin (plot.m, mean.m, …): run resolves the script first and shadows the function, so plot.m fails with "不支持将脚本 plot 作为函数执行".
  • One session per host, shared by the panel and the agent tool; a long pause or an infinite loop blocks that session until Stop.
  • The variables panel lists base-workspace variables only, and it needs a running session (before the first run it says "session not started").
  • Windows is untested; sessionArgs/extraArgs and the launcher path would need adjusting.
  • Until the first successful run (or a manual Save) buffers live in localStorage only, so they survive tab switches and page reloads but not a different browser or a cleared profile.
  • Syntax highlighting is a tokeniser, not a parser: it does not fold blocks, and a % inside an unusual context can still be read as a comment.
  • .mlx is preview only — the panel renders what MATLAB saved, but cannot edit or run a live script (that needs the Live Editor engine). Section counts are a heuristic for live scripts imported from Word; the order of blocks is always the document order.
  • Stopping or restarting the session asks MATLAB to exit first, so no -nodesktop process is left behind. A long-running -nodesktop MATLAB does register with macOS under MATLAB's bundle id, which can make a Finder double-click look like a no-op (the windowless instance receives the activation). Fix: open -n -a /Applications/MATLAB_R2026a.app or quit the session; in VS Code set MATLAB.matlabConnectionTiming to onDemand.
  • The file tree is rooted at workdir; it does not follow the DSH workspace switcher or show git status.
  • MATLAB file names must start with a letter: a generated helper named _vars.m fails with "文本字符无效".

License

MIT © 2026 seally-web

  • Variables (Σ 变量) — the live workspace: name, class, and size for every base-workspace variable. The host asks MATLAB to write whos as JSON into .dsh-matlab-runner/vars.json and reads it back, so the list is never truncated by the console. Refreshed automatically after each run.
  • Figures — image files touched by the run (.png/.jpg/.svg/.gif/.webp) show as thumbnails under the console; click one to open the full image in a tab. With session mode the figure window also opens on the desktop.
  • Live scripts (.mlx) — clicking an .mlx in the file tree opens a read-only preview: text with headings, colourised code blocks, text outputs, and inline figures. Parsing is local (lib/livemd.js: ZIP + OOXML, no MATLAB needed). Run/Save are disabled while previewing; close the preview to edit.
  • Settings — run mode, the graphics warm-up flag, every path, the timeout, the config location, and a Restart session button.