Coding-learn floating panel: edits and runs Python/JavaScript/TypeScript/PowerShell with exit code and timing, grades JSON course lessons with progress export, keeps Markdown notes and snippet library, and sends code plus a question into the current conversation for the main model to answer.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-coding-plugin
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Paimonshen/dsh-coding-plugin
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
一个面向编程学习者的 DSH 动态 Cordis 插件:右侧悬浮窗集成代码编辑器、多语言执行、课程关卡评判、进度追踪、笔记与片段库;代码分析直投当前对话,由对话主模型直接输出,全程中文界面、深浅色自适应。
适用环境:DeepSeek Harness(DSH)桌面版,支持动态 Cordis 插件的会话。
功能一览
| 功能 | 说明 |
|---|---|
| 右侧悬浮窗 | 会话内输入 /coding 激活,右下角「🧩」按钮展开 7 页签面板,可拖拽 / 八向缩放 |
| 代码执行 | Python / JavaScript / TypeScript / PowerShell,输出 stdout / stderr / 退出码 / 耗时;打开面板自动预热解释器 |
| 一体式结果卡 | 状态头(退出码·耗时,成功绿 / 失败红)+ 输出体上下分区,stdout 与 stderr 同卡展示 |
| 课程系统 | 导入 JSON 课程包;关卡自动评判(包含 / 等于 / 不包含);提供提示与参考答案 |
| 进度追踪 | 关卡状态、完成时间、尝试次数;导出 JSON / Markdown 落盘工作区 |
| 笔记 | Markdown 笔记,可关联关卡 |
| 片段库 | 保存 / 复制代码片段 |
| 分析直投对话 | 点「📨 分析(发到对话)」→ 代码+问题作为用户消息进入当前会话,由对话主模型直接输出分析,严格会话对应 |
| 会话门控 | 每个会话独立激活(/coding 开、/coding close 关),互不影响 |
| 模型工具 | 注册 coding_run / coding_submit / coding_progress / coding_note / coding_lesson / coding_snippet / coding_analyze 7 个工具供对话调用 |
| 动效 | 开合动画对称(上浮入场 / 下沉出场)、按压反馈、成功弹跳 / 失败抖动、prefers-reduced-motion 回退 |
安装
已发布到 npm,可直接安装:
npm install dsh-coding-plugin
或由 DSH 插件管理器从仓库安装(仓库与包均声明了 dsh.bundle 清单):
dsh plugin add dsh-coding-plugin # 走 npm 预构建包
dsh plugin add Paimonshen/dsh-coding-plugin # 走 GitHub 源码
也可以直接在 DSH 对话中让我「安装 dsh-coding-plugin 并启用」。
走 npm 安装可跳过源码构建的
allowBuilds构建授权步骤。
使用方法(DSH 内)
- 激活:会话内输入
/coding—— 打开本会话悬浮窗并注入使用指导;/coding close关闭。 - 运行代码:编辑器页选择语言 → 编写 → 「▶ 运行」;stdin 可选。
- 分析代码:编辑器页点「📨 分析(发到对话)」—— 切回聊天即可看到对话主模型的分析回复。
- 课程:课程页粘贴
examples/course-sample.json内容导入 → 课程关卡页提交解答自动评判 → 进度页导出。 - 对话内使用:直接说「用 python 跑这段代码 / 提交关卡 / 导出进度 / 记笔记 / 分析这段代码」,我会调用对应
coding_*工具。
目录结构
dsh-coding-plugin/
├── src/client/
│ ├── fw.js # 框架层:主题令牌 T / 内核 K(RPC+轮询)/ 原语 P / 流式组件 / useRun
│ └── app.js # 应用层:7 个页签工厂 + TABS 注册表 + 悬浮窗外壳
├── source/ # 构建产物(发布用):client.js / host.js
├── tools/
│ └── build.js # 构建:合并折叠 + JSON 安全校验 + 双半边语法校验
├── examples/
│ └── course-sample.json
├── cordis.patch.yml # DSH bundle 清单引用的插件挂载补丁
└── package.json # 含 dsh.bundle / dsh.client 清单(可被 dsh plugin add 安装)
在 DSH 中加载
方式一:插件管理器安装(推荐)
dsh plugin add dsh-coding-plugin
装上后输入 /coding 即可使用。
方式二:手动加载(开发 / 调试用)
插件为双半边纯 JS(无构建器转换):
node tools/build.js生成source/client.js与source/host.js;- 在 DSH 对话中让我通过
cordis_define(kind: "new",idPrefix: "coding")定义插件:code.host←source/host.js,code.client←source/client.js; cordis_run激活(首次run);- 输入
/coding开始使用。
注意:手动加载的动态插件不跨 DSH 进程重启——重启后需重新
cordis_define+cordis_run(仓库源码随时可重建);用dsh plugin add安装则不受此限。
源码约定(改代码必读)
src/client/*.js源码只允许单引号与反引号:禁止双引号、反斜杠、行注释(//)——构建产物需可无损嵌入cordis_define的 JSON 参数,构建脚本会校验(JSON-SAFE FAIL 即失败);- Client 沙箱禁用原生定时器:一律用 Cordis
timer服务(timer.timeout(cb,ms)/timer.interval(cb,ms)→ disposer); - 非阻塞执行:Host 用
shell.start→await proc.done→proc.readOutput()采增量;禁用阻塞的shell.run; - 页签新增:在
app.js的TABS数组加一条{ key, label, make },make(F)返回 React 组件即可(F提供h/T/K/P/useRun/...)。
数据与权限
- 用户数据仅存当前工作区
.dsh-coding/(state.json、导出的 progress.json/md),不出本地; - 代码执行沿用 DSH 沙箱策略(通常
workspace-write),命令超时 20s。
已知边界
- 动态插件随进程重启丢失,需重新定义激活(一次性操作);
- 分析直投对话要求目标会话处于运行状态;会话已关闭时会返回可读错误;
--experimental-strip-types依赖 Node ≥22.6 的 TS 直接执行能力。
License
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10406
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10406
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 7675
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7201
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5142
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 988
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.