deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
HuanLinOTO/dsh-plugin-interpreters
暴露 run_python/run_node 工具,通过 stdin 执行代码返回 stdout/stderr/exit,含解释器路径配置卡 | Exposes run_python/run_node tools that execute code via stdin and return stdout/stderr/exit, with interpreter-path config card
PROJECT TOPICS
PROJECT README
DSH 插件:暴露 run_python 和 run_node 两个模型可调用工具,通过 stdin 执行代码并返回 stdout/stderr/exit code。在设置页「插件配置」分区提供配置卡片,让用户设置 Python 和 Node.js 解释器的可执行文件路径,工具描述中会告知模型解释器位置。
run_python / run_node,通过 spawn(executable, ['-']) 执行代码,代码经 stdin 传入(无命令行长度限制)cordis.patch.yml 行配置(行 id dsh-interpreters),运行时改动写入 profile 的 cordis.patch.yml;三个字段都标了 .volatile(),Loader 直接提交新引用值,不重新挂载插件/interpreters/api 前缀路由,在进程内调 ctx.settings.update(ns, patch)。ns 必须是该插件在 profile 里的行 id dsh-interpreters(不是包名,也不是短名),否则每次保存都会失败并返回 No configurable plugin entryplugins.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 配置层CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。