返回插件市场

dsh-plugin-interpreters

编程与工具

HuanLinOTO/dsh-plugin-interpreters

暴露 run_python 和 run_node 工具,通过 stdin 执行代码并返回 stdout、stderr 和退出码,提供解释器路径配置卡片。

  • dsh-plugin
GitHub Stars
9GitHub
浏览量
7DSH Plugin Hub
Forks
0GitHub
开放问题
0GitHub Issues
Manifest 版本
0.2.3@huanlin/dsh-plugin-interpreters
最近推送
2026年10月6日GitHub
许可证
NOASSERTIONJavaScript
插件类型
Host + Client同时运行于 Host 与 Web Client

验证与兼容性

这里展示目录实际采集到的证据;未声明的信息会明确标为未知。

静态检查通过
01精确来源: github · @huanlin/dsh-plugin-interpreters@0.2.302验证时间: 2026年8月23日03验证版本: 0.1.0-rc.7
当前版本兼容性
已在当前目录版本验证
声明的 Harness 范围
未声明
声明的平台
未声明
适用 Profile
web
构建授权
未知
权限声明
未声明
外部服务
未声明
遥测声明
未知
未发现已知风险标记

这不是安全背书;安装前仍应查看源码、权限和配置。

查看证据与判定范围

验证仅覆盖标出的来源、版本和 Harness 环境,不代表未来版本仍然兼容。

  • github:HuanLinOTO/dsh-plugin-interpreters#acac7323588844b1af81789a1963dfd356b91102
  • 插件通过清单与静态结构检查,尚未完成运行时加载检查。

README

查看源文件

dsh-interpreters

npm version

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

架构

  • 工具:run_python / run_node,通过 spawn(executable, ['-']) 执行代码,代码经 stdin 传入(无命令行长度限制)
  • 设置持久化:配置来自插件 bundle 的 cordis.patch.yml 行配置(行 id dsh-interpreters),运行时改动写入 profile 的 cordis.patch.yml;三个字段都标了 .volatile(),Loader 直接提交新引用值,不重新挂载插件
  • 动态 description:工具只注册一次,执行时读取当前 volatile 引用,路径改动对下一次运行立即生效
  • 配置暴露:DSH 的 settings RPC 域只向配置客户端提供白名单命名空间,插件因此在 host 上自行注册 /interpreters/api 前缀路由,在进程内调 ctx.settings.update(ns, patch)。ns 必须是该插件在 profile 里的行 id dsh-interpreters(不是包名,也不是短名),否则每次保存都会失败并返回 No configurable plugin entry
  • 客户端 bundle:配置卡片注册进插件页的 plugins.row.config 槽(key @huanlin/dsh-plugin-interpreters#dsh-interpreters),用 fetch('/interpreters/api/get'|'set') 读写;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: 声明 auto:false 页面策略,返回 bridge (source())
├── gateway.ts            # registerHttpGateway: /interpreters/api 前缀路由(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(fetch /interpreters/api/get|set)
    ├── 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-interpreters 行的配置卡片修改,持久化到 profile cordis.patch.yml 中该行的 config。

检查

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

验证 lib/ 产物:

  • lib/index.js — host 入口(ESM,tsc 产物;@deepseek-ai/* 与 @deepseek-ai/schemastery 保持外部引用)
  • lib/client.js — client bundle(CJS,window.__ModuleLoader__.load 包裹,external: react)
  • lib/types/ — TypeScript 声明文件
  • cordis.patch.yml — bundle 配置层

评论

0
最新优先