dsh-prompt-history
English | 中文
DSH(DeepSeek Harness)社区插件:composer 的 ↑/↓ 历史提示词导航。不用离开输入框,就能翻阅当前会话里已经发送过的提示词——按 ↑ 召回最近一条,用 ↑/↓ 浏览更早的条目,并始终保住你正在写的草稿。
浏览时,composer 工具行会出现小徽章 历史 x/y。
功能
↑/↓浏览当前会话已发送的提示词(user + steering 节点),最新的在前。- 相邻重复项会合并。
- 尊重多行草稿:只有光标在第一行时,
↑才会开始浏览。 - 发送消息或切换会话时自动退出浏览;在最新一条再按
↓会恢复之前保存的草稿。 - 按键监听绑在 composer 卡片(
[data-composer-card])上,不挂window。侧栏搜索等其它输入不受影响。
要求
- DeepSeek Harness 的 web profile(profile 名称任意;下文示例用
web)。
安装
仓库已提交编译好的 lib/,安装不需要构建步骤。
方式 A — tarball
cd dsh-prompt-history
npm pack # → dsh-prompt-history-0.1.0.tgz
dsh plugin --profile web add ./dsh-prompt-history-0.1.0.tgz方式 B — git(安装最新版)
dsh plugin --profile web add github:cw1999mm/dsh-prompt-history然后重启(或刷新)Web UI。插件会作为 dsh-prompt-history 组合包层加载;卸载:
dsh plugin --profile web remove dsh-prompt-history手动 / 开发安装
把包 link 进 profile 的 node_modules,并加上组合包行:
# 在 profile 目录下(例如 ~/.dsh/profiles/web)
pnpm add link:<本项目的绝对路径>然后在该 profile 的 cordis.patch.yml 末尾追加:
- insert:
- id: dsh-prompt-history
name: dsh-prompt-history用法
1. 聚焦 composer,输入或不输入都可以——草稿会自动保存。 2. 按 ↑(光标在第一行)加载本会话最近发送的提示词。 3. ↑/↓ 在更早 / 更新的提示词之间移动;历史 x/y 徽章显示当前位置。 4. 在最新一条再按 ↓(或直接发送)回到原来的草稿。
原理
lib/index.js— 宿主半边。刻意留空:只为了在 cordis 组合里占一个会激活的行。lib/client.js— 浏览器半边,通过包的dsh.client声明被发现。它导出inject = ['slots'],等该服务就绪后挂到conversation.input.right,在 composer 卡片上绑定 ↑/↓,并从当前会话快照构建提示词历史。
许可证
[MIT](./LICENSE) © 2026 cw1999mm