Composer helpers for DeepSeek Harness: Up on an empty input recalls the last message you sent, the sparkle button rewrites the draft into a structured prompt with the session model, and a template panel inserts reusable prompts at the caret without sending.
Install
# from a prebuilt release tarball
dsh plugin --profile web add -w "https://github.com/16bh/dsh-prompt-history-lite/releases/latest/download/dsh-prompt-history-lite.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:16bh/dsh-prompt-history-lite
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.
A deliberately small prompt helper for the DeepSeek Harness composer: recall your last message, rewrite a draft into a structured prompt, drop in a reusable template — three everyday things and nothing else.

The community plugin dsh-prompt-history does much more than this, and it keeps a lot of machinery resident in the composer, which shows up as typing lag. This plugin re-implements the three parts that get used every day and drops the rest: no clipboard history, no inline autocomplete, no ghost text, no feedback panel.
What it does
1. ↑ on an empty composer recalls your last message
Typing nothing, press ↑ and the most recent message you sent in this session appears in the composer. Press ↑ again to walk back through older messages, ↓ to walk forward, and ↓ past the newest one restores the draft you started with. Esc leaves browsing at any time. Nothing is ever sent automatically.
The history is read from the session on the host the first time you press ↑, then kept for that browsing pass only — it is dropped as soon as you edit the draft or send.
2. ✨ rewrites the draft into a structured prompt
The ✨ button in the composer action row sends the current draft to the session's own model and shows the result next to the original:

- The rewrite targets role and goal, context and constraints, executable steps, output format, acceptance criteria, and edge cases — and only the sections the draft actually needs, aiming for roughly 1–3× the original length instead of padding every heading.
- You get apply, copy, retry and close. Applying replaces the draft and offers one undo; nothing is written into the composer until you say so, and a result that arrives after you have kept typing is discarded rather than overwriting your text.
- The call is streamed, so text appears as it is generated, and it is cancelled when you close the panel.
- The draft is sent inside
<draft>…</draft>and treated as data, not as instructions.
3. 📋 reusable prompt templates
The 📋 button opens a panel of templates. Clicking a row inserts its body at the caret, without sending and without replacing what you have already written.

Five starting templates ship built in — code review, explain code, write tests, find edge cases, refactor suggestions — and you can add, edit and delete your own. Deleting offers an undo. Drag a row by the grip on its left to reorder the list; the order is saved to the file.
The templates live in ~/.dsh/prompt-history-lite/templates.json, a plain JSON array on the host, and that file is the only source of truth. The prompt_templates agent tool reads and writes the same file, so you can also ask the model to add, rewrite or prune templates for you, and the panel shows the change the next time you open it. The five starting templates are served only while the file does not exist; once anything has been saved — including an empty list — the file wins and deleted templates stay deleted. Templates from the old localStorage store are migrated into the file the first time the panel opens, and the old key is removed once the write succeeds.
The panel follows the host theme, light or dark:

Settings
Settings → Prompt history lite has two switches, both on by default: prompt enhancement and prompt templates. ↑ recall has no switch; it is the reason the plugin exists.
Install
dsh plugin --profile <your profile> add github:16bh/dsh-prompt-history-lite
From a local checkout, point the profile at the directory with link::
git clone https://github.com/16bh/dsh-prompt-history-lite.git
dsh plugin --profile <your profile> add link:$PWD/dsh-prompt-history-lite
The browser half is picked up on page reload; the host half registers its four routes at startup, so restart DSH once after installing.
Implementation notes
- No build step. Plain ESM, no bundler, no dependencies.
index.jsis the host half,client.jsthe browser half, loaded through the host's module loader. - Four routes, all under
/api/prompt-history-lite/:history(the session's sent messages),enhance(one-shot),enhance/stream(NDJSON, one frame per line) andtemplates(GET/PUT the template store as a whole). Requests are admitted through the host connection service, the same check the host applies to its own API. - History is computed on demand. The host folds the session's events into a list of sent message bodies when asked, instead of watching the DOM or subscribing to every event on the client.
- One resident listener. A single captured
keydownondocument, removed on unmount, handles↑/↓/Escand only while the composer is empty. NoMutationObserver, no timers, no polling, noselectionchange/scroll/resizehandlers. - The model route follows the session. The enhancement runs on whatever provider, model and reasoning effort the current session resolved to, at the lowest reasoning effort the model offers — rewriting is generation, not deliberation.
- Panels are plain DOM. The client loader hands the plugin React, and React owns the two buttons in the action row; the panels and the toast are built with
document.createElementand mounted next todocument.body, which keeps them out of the composer's re-render path. - Colours come from host theme tokens (
--dsw-alias-*), so light and dark mode both follow the host without a hard-coded palette. - Templates have a single source of truth:
~/.dsh/prompt-history-lite/templates.json, at most 200 entries, 8000 characters per body. Writes go to a temp file and are renamed into place; the panel and theprompt_templatestool share one serialized read-modify-write chain, so they cannot overwrite each other.localStorageis only a fallback for hosts without the route, and the place the old templates are migrated from.
Development
node --check index.js
node --check client.js
node --test test/host.test.mjs
The tests cover the host-side helpers: event folding, history extraction, request admission, length limits and the NDJSON framing.
License
MIT. The idea for the plugin comes from dsh-prompt-history; no code is copied from it — this is a smaller implementation written from scratch.
中文说明
给 DeepSeek Harness 输入框用的轻量提示词工具,只保留三件每天都会用的事:召回上一条消息、把草稿改写成结构化提示词、插入常用模板。

社区插件 dsh-prompt-history 功能更全,但它在输入框旁边常驻了不少东西(全局事件、观察器、定时器),表现出来就是打字卡顿。这个插件只重写了最常用的三块,其余一概不做:没有剪贴板历史、没有行内补全、没有 ghost 文字、没有反馈面板。
功能
一、空输入时按 ↑ 召回上一条消息
输入框为空时按 ↑,本会话最近一条发过的消息出现在草稿里;继续 ↑ 往前翻,↓ 往回退,退过最新一条之后恢复你原本的草稿;Esc 随时退出浏览。整个过程不会发送任何东西。
历史是第一次按 ↑ 时从宿主侧现算一次,只在这一次浏览里复用;一旦你改动草稿或发送,缓存即失效。
二、✨ 把草稿改写成结构化提示词
点输入框动作行的 ✨,当前草稿会交给当前会话使用的模型改写,结果和原文并排显示:

- 改写覆盖角色与目标、上下文与约束、可执行步骤、输出格式、验收标准、边界情况,并且只写草稿真正需要的小节,目标长度约为原文 1–3 倍,不硬凑标题。
- 面板提供应用 / 复制 / 重试 / 关闭。应用会写入草稿并给一次撤销;在你点应用之前不会动草稿,改写结果回来时如果你已经继续打字,它会丢弃结果而不是覆盖你新写的内容。
- 调用是流式的,字出着就显示;关掉面板会中断在途请求。
- 草稿包在
<draft>…</draft>里发送,按数据处理,不按指令处理。
三、📋 常用提示词模板
点 📋 打开模板面板,点一行就把正文按光标位置插进草稿——不发送,也不覆盖你已经写的内容。

装好就有 5 条起步模板(代码审查 / 解释代码 / 写测试 / 找边界情况 / 重构建议),可以自己新增、编辑、删除,删除有撤销。鼠标移到行上,左边会出现拖动把手,按住拖动即可调整顺序,顺序会写进文件。
模板存在宿主上的 ~/.dsh/prompt-history-lite/templates.json(一个纯 JSON 数组),这份文件是唯一数据源。agent 工具 prompt_templates 读写的是同一个文件,所以也可以直接让模型帮你加、改、删模板,下次打开面板就能看到。只有文件还不存在时才给 5 条起步模板;一旦保存过(哪怕保存的是空列表)就以文件为准,删掉的模板不会自己长回来。老版本存在 localStorage 里的模板会在第一次打开面板时自动迁移到文件里,写成功后再删掉旧 key。
面板跟随宿主深浅色主题:

设置
设置页「提示词历史 Lite」有两个开关,默认都开:提示词增强、提示词模板。↑ 召回没有开关,它就是本插件存在的理由。
安装
dsh plugin --profile <你的 profile> add github:16bh/dsh-prompt-history-lite
本地目录用 link::
git clone https://github.com/16bh/dsh-prompt-history-lite.git
dsh plugin --profile <你的 profile> add link:$PWD/dsh-prompt-history-lite
前端半区刷新页面即生效;宿主半区在启动时注册四条路由,装完重启一次 DSH。
实现要点
- 无构建:纯 ESM,无打包器、无依赖。
index.js是宿主半区,client.js是浏览器半区,走宿主的模块加载器。 - 四条路由,都在
/api/prompt-history-lite/下:history(本会话发过的消息)、enhance(一次性)、enhance/stream(NDJSON,一行一帧)、templates(GET/PUT 整表读写模板库)。请求走宿主连接服务的准入校验。 - 历史按需计算:宿主在你按
↑时才折叠会话事件,客户端不监听 DOM、不订阅事件流。 - 只有一个常驻监听:
document捕获阶段的一个keydown,卸载时移除,只在草稿为空时接管↑/↓/Esc。没有MutationObserver、没有定时器、没有轮询、没有selectionchange/scroll/resize。 - 模型跟随会话:用当前会话解析到的 provider / model,并把推理强度降到该模型最省的一档——改写是生成,不是思考。
- 面板用原生 DOM:动作行的两个按钮是 React 组件,面板和 toast 用
document.createElement挂到document.body旁边,不进入输入框的重渲染链路。 - 配色全走宿主主题令牌(
--dsw-alias-*),深浅色都不写死颜色。 - 模板只有一个数据源:
~/.dsh/prompt-history-lite/templates.json,最多 200 条,单条正文上限 8000 字。写入先落临时文件再 rename;面板和prompt_templates工具共用同一条串行读改写链,不会互相覆盖。localStorage只作为没有该路由的老宿主的兜底,以及老数据的迁移来源。
开发
node --check index.js
node --check client.js
node --test test/host.test.mjs
测试覆盖宿主侧的纯函数:事件折叠、历史提取、请求准入、长度上限、NDJSON 分帧。
许可
MIT。插件思路来自 dsh-prompt-history,未复制其代码,本实现是重写的更小版本。
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10715
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★ 10715
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★ 8617
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7532
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★ 5410
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1099
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.