npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-input-history

v1.1.3

Published

Shell-style prompt history in the DeepSeek Harness composer: ArrowUp walks back through the messages you already sent, ArrowDown walks forward and restores your draft.

Readme

dsh-input-history

npm license dsh

在输入框中按 ↑ / ↓ 逐条回溯本会话已发送的消息,并回填为草稿。


效果

输入框为空时按 ↑ 从最近一条开始向前回溯,↓ 向前返回。回溯时右下角显示位置:

3/19        ← 当前第 3 条(由新到旧),共 19 条

↑  然后再开发一个插件 就是在输入框按上下键 能按顺序回填之前发过的消息
↑  换
↓  换
↓  (恢复原草稿)

越过最新一条后,恢复开始回溯前的草稿。手动编辑即退出回溯。


安装

市场索引

https://raw.githubusercontent.com/Dogtiti/dsh-predict/main/market-index.json

设置 → 插件 → 启用实验性市场 bundle → Discover → 添加上面的地址 → 安装 dsh-input-history。

npm

npm i dsh-input-history

在 Plugins 页用「添加」填写包名。

本地目录

git clone https://github.com/Dogtiti/dsh-input-history

Plugins → 添加 → 选择该目录。


行为

| 按键 | 行为 | | --- | --- | | ↑ | 输入框为空时开始回溯,从最近一条向前;到达最旧一条后停止 | | ↓ | 向前返回;越过最新一条时恢复原草稿 |

不接管的情况:

| 条件 | 行为 | | --- | --- | | 输入框已有内容或附件 | ↑ 保留给编辑器的光标与选区移动 | | 焦点不在该输入框 | 不处理 | | 带 Alt / Ctrl / Cmd / Shift | 不处理 | | / 或 @ 菜单已认领输入 | 方向键归菜单 |


配置

- insert:
    - id: composer-history
      name: 'dsh-input-history'
      config:
        limit: 50

| 键 | 默认 | 说明 | | --- | --- | --- | | enabled | true | 总开关;关闭后路由返回 503,客户端不接管按键 | | limit | 200 | 保留的历史条数(取最近) | | maxChars | 2000 | 单条消息最大字符数(保留头尾) | | cacheTtlMs | 30000 | 相同会话事件序号下的缓存时间 |


实现

┌──────────────── 浏览器 ────────────────┐        ┌───────────── Host ─────────────┐
│ conversation.composer.dock             │        │ POST /api/composer.history     │
│  · 捕获阶段拦截 ↑ / ↓                    │  HTTP  │  · sessions.get(id)            │
│  · 状态机:index = -1 表示未回溯          │ ─────► │  · session.deriveMessages()    │
│  · setDraft(items[index])               │ ◄───── │  · 按 source kind 过滤          │
│  · 位置计数,编辑后退出                    │  JSON  │  · 按 seq 缓存 30s             │
└────────────────────────────────────────┘        └────────────────────────────────┘

历史来自会话日志。Host 侧仅保留 role: user 且 source.kind === 'user' 的文本,其余按来源排除:

{ "kind": "user" }             // 用户输入,计入历史
{ "kind": "runtime-context" }  // 运行时上下文快照,排除
{ "kind": "skill-catalog" }    // 技能目录,排除
{ "kind": "time-context" }     // 时间戳提示,排除
{ "kind": "user-approval" }    // 审批策略通知,排除

相邻重复消息合并为一条。结果按会话事件序号缓存 30 秒。

回填使用 inputActions.setDraft(),与手动输入共用同一条草稿链路(可撤销、按会话持久化),不直接操作 DOM。


兼容性

  • DSH ^0.2.1-0(engines.dsh)。
  • 依赖公开的 inputActions.setDraft()。

开发

node --test "test/*.test.mjs"

11 项:提取顺序、注入内容过滤、相邻去重、数量与长度限制、缓存失效、开关、槽位注册形状、计数渲染、缺少 hooks 时不渲染。


相关插件

| 插件 | 说明 | | --- | --- | | dsh-predict | 预测下一条指令并显示为占位文字,Tab 采纳 | | dsh-input-history(本仓库) | 输入框中按 ↑ / ↓ 回填历史消息 | | dsh-subagent-bridge | 让 Codex 通过本机 MCP 把 DSH 当 subagent 用(spawn / wait / followup),反向也能把任务派给 Codex | | dsh-quota-meter | 在模型选择器旁显示供应商套餐额度余量(目前 GLM Coding Plan),点开是明细浮层 | | dsh-provider-icons | 在模型名旁显示供应商品牌 logo(24 个厂商,支持前缀匹配) |

许可

MIT © Dogtiti