dsh-session-input-history
Manifest validDSH session-isolated input history navigation plugin (pure client, dual-sided): In the conversation input box, use the ↑/↓ arrow keys to traverse messages sent during the current session (shell history-style interaction); editing or sending while browsing exits immediately. The difference from the global history plugin is that history is strictly limited to the current session.
dsh-session-input-history
DSH 会话隔离的输入历史导航插件(纯 client):对话输入框中按 ↑/↓ 方向键遍历当前会话发送过的消息(shell history 式交互)。
与全局历史插件的区别:历史严格限定在当前会话内。切换到别的会话,↑ 拿到的就是那个会话自己的历史;新会话从空白开始,不会被其他会话或工作区的输入污染。历史也不落盘。
安装
方式一:从 npm 安装(推荐)
dsh plugin --profile web add dsh-session-input-history
发布到 npm 的 tarball 已包含构建产物(
lib/),安装即用,不需要授权构建脚本。
方式二:从 GitHub 安装
dsh plugin --profile web add github:czhzz/dsh-session-input-history
适合跟进未发布的提交。建议锁定 commit(
github:czhzz/dsh-session-input-history#<sha>)。
交互
| 按键 | 行为 |
|---|---|
| ↑ | 草稿为空时 → 载入最新一条历史消息;再次按 ↑ 继续向前(更旧) |
| ↓ | 浏览中向后(更新);到最新一条后再按 ↓ → 清空输入框(退出浏览) |
| 浏览中编辑 | 正常编辑,不受影响 |
| 浏览中发送 | 发送当前载入的消息 |
- 历史范围:当前会话发送过的用户文本消息(去空白、相邻重复去重)
- 焦点不在输入框时不接管方向键;带 Ctrl/Alt/Cmd/Shift 的组合键一律不接管,保持原生行为(选词、移动光标等)
- 无任何 UI 常驻(纯键盘)
验证
# 1) 配置树里出现插件行
dsh --profile web --dump-config | grep dsh-session-input-history
# 2) 浏览器里:发两条消息 → 清空输入框 → 按 ↑ 应回显最新一条,再按 ↑ 回显更旧一条
开发
npm install
npm run build # host: tsc → lib/index.js;client: esbuild → lib/client.js
npm test # 纯函数单测(历史提取 + 导航状态机)
结构:
src/
├── index.ts # host 半侧(空 apply,无 host 行为)
└── client/
├── history.ts # 纯逻辑:chat 快照 → 历史数组、方向键状态机(无框架依赖,可直接单测)
└── index.ts # client 接线:slot 注册 + 标准 props 订阅 + document 捕获方向键
scripts/build.mjs # esbuild 打包 client(lazy-CJS factory)
实现注记(对齐 dsh 0.1.6-alpha 一代)
- 挂载点:
conversation.input.left(session scope 的 list slot),框架按 scope 通过 standard provide channel 注入useInput/useConversation/inputActions。 - 历史来源:
useConversation选出的 chat 视图快照(ConversationViewSnapshotMap的'chat'槽),取用户消息节点。视图快照本身按会话隔离。 - 草稿读写:
useInput读draft,inputActions.setDraft写回——不再操作 DOM 受控组件。 - 键盘:新版
ComposerKeyboard是包内私有面(契约明确不跨插件边界),插件没有官方键盘仲裁,因此在document捕获阶段接管方向键,用data-lexical-editor标记确认焦点在 composer(新版 composer 是 Lexical 编辑器,不再是textarea)。
卸载
dsh plugin --profile web remove dsh-session-input-history
Comments
Loading…
From the same category
by awesome-dsh-plugin
A curated list of plugins for DeepSeek Harness (dsh) · DeepSeek Harness 插件精选列表
★ 18k
CC0-1.0
Python
Oct 8, 2026
by 0xsline
DeepSeek Harness (DSH) ecosystem: curated plugins, tools, and infrastructure from dsh-external/hub and the public dsh-plugin topic.
★ 1.1k
CC0-1.0
Python
Sep 30, 2026
by pax-beehive
Open-source CLI, schemas, resolver, and DSH agent tools for DSH Plugin Hub
★ 458
MIT
TypeScript
Oct 6, 2026
by yjh051108
推荐组件(非必须):DeepSeek Harness 运行时注入器;已随 dsh-routing-suite 单仓库化保留,本仓库继续维护/发布。
★ 164
TypeScript
Sep 18, 2026
dsh plugin --profile web add @dsh-external/dsh-super-injectorby xiajiajun516
DeepSeek Harness (DSH) backup & restore plugin — export, import, migrate and sync your complete DSH configuration, plugins, MCP servers, skills and workspace. One-click migration to another machine.
★ 164
MIT
TypeScript
Oct 7, 2026
dsh plugin --profile web add dsh-config-managerby jigjoy-ai
A CLI that turns a goal into a pull request - and a sandbox for testing concurrent AI coding agents on the Mozaik runtime.
★ 124
MIT
TypeScript
Oct 2, 2026