dshbase

插件目录 / Developer / dsh-plugin-interpreters

dsh-plugin-interpreters

未验证 HuanLinOTO

✓ 持续维护 基于 10 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

10Stars
0Forks
0未关闭 issue
JavaScript语言
2026-08-19最近推送
跨平台平台

功能简介

无描述

我们的评价
未验证 — 尚未实测

无描述 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

dsh-plugin-interpreters card

dsh-interpreters

npm version

DSH 插件:暴露 run_pythonrun_node 两个模型可调用工具,通过 stdin 执行代码并返回 stdout/stderr/exit code。在设置页「插件配置」分区提供配置卡片,让用户设置 Python 和 Node.js 解释器的可执行文件路径,工具描述中会告知模型解释器位置。

架构

  • 工具run_python / run_node,通过 spawn(executable, ['-']) 执行代码,代码经 stdin 传入(无命令行长度限制)
  • 设置持久化:通过 ctx.settings 命名空间 interpreters 持久化到 $DSH_HOME/settings.yaml
  • 动态 description:工具的 description 在注册时根据配置计算,包含解释器路径;设置变更时通过 bridge.onChange() 自动重新注册
  • 配置暴露(TypertRemoteService 模式):DSH 的 settings RPC 域(api-proxy)只向配置客户端提供白名单命名空间(interpreters 不在其中),所以浏览器通过 host 内置的 typertRemote /api RPC 通道读写 interpreters 命名空间——InterpretersConfigGateway 继承 TypertRemoteService 并用 @Remote('get') / @Remote('set') 标记方法,typertRemote 的 SRC discovery 自动 claim /api/interpreters/get/api/interpreters/set 端点。gateway 在 host 进程内 in-process 调 ctx.settings.update(ns, patch),绕过 wire-layer allowlist
  • 客户端 bundle:配置卡片通过 settings.plugin.item slot 注册(「插件配置」分区),卡片用 connection.rpc.call('/api', 'interpreters/get'|'set', { args: {...} }) 读写,不依赖 settingsScope(因为 interpreters 不在白名单中);connection/reset 事件触发卡片重载

开发

pnpm install          # 安装依赖(link: 指向 ~/.dsh/source/current/)
pnpm run typecheck    # tsc --noEmit
pnpm test             # vitest run
pnpm run build        # tsdown + tsc(生成 lib/index.js, lib/client.js, lib/types/*.d.ts)

目录结构

src/
├── index.ts              # Host 入口:name, inject, apply(实例化 bridge + gateway + 工具注册)
├── config.ts             # Config schema (schemastery), ResolvedConfig, resolveConfig
├── settings.ts           # installInterpretersSettings: 注册 namespace,返回 bridge (source() + onChange())
├── gateway.ts            # InterpretersConfigGateway: TypertRemoteService + @Remote('get'|'set')
├── tools.ts              # registerTools: 注册 run_python + run_node
├── runner.ts             # runCode: spawn + stdin + stdout/stderr 收集
└── client/
    ├── index.ts          # Client 入口:slots.inject('settings.plugin.item') + connection/reset
    ├── store.ts          # 卡片响应式 store(通过 connection.rpc 读写 /api/interpreters/*)
    ├── InterpretersCard.tsx  # 配置卡片组件
    └── locales.ts        # i18n (zh + en)

运行

本地安装

# 从 npm 安装(推荐):
dsh plugin --profile web add @huanlin/dsh-plugin-interpreters

# 本地开发(热更新):
dsh plugin --profile web add "link:D:/Projects/deepseek-harness/dsh-interpreters"

配置

默认配置(cordis.patch.yml):

pythonPath: 'python'    # Python 可执行文件路径
nodePath: 'node'        # Node.js 可执行文件路径
timeoutMs: 30000        # 执行超时(毫秒)

运行时通过设置页「插件配置」分区的卡片修改,持久化到 $DSH_HOME/settings.yaml

检查

pnpm run typecheck && pnpm test && pnpm run build

验证 lib/ 产物:

  • lib/index.js — host bundle(ESM,external: @deepseek-ai/dsh-typert-protocol, @deepseek-ai/dsh-settings, @deepseek-ai/dsh-tools, schemastery
  • lib/client.js — client bundle(CJS,window.__ModuleLoader__.load 包裹,external: react
  • lib/types/ — TypeScript 声明文件
  • cordis.patch.yml — bundle 配置层

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-plugin-interpreters」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:HuanLinOTO/dsh-plugin-interpreters

Headless(CLI)profile:

dsh plugin --profile headless add github:HuanLinOTO/dsh-plugin-interpreters

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending
备注:验证: runtime-fail (0.1.0-rc.6) 浏览全部待验证失败 →

使用场景

扩展 agent 的编码能力面——给它一个新工具、工作流或集成,让它接手以前做不了的开发任务。

适合谁

想让 dsh 在真实代码库上像队友一样干活的开发者——能改、能跑、能验证,而不只是回答问题。

二次开发建议

工具/命令面就是缝:暴露更多 SDK 能力、加更聪明的上下文接线,或收紧改代码与验证之间的循环。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7795 个插件 →