Skip to content
dsh.fish
Bundle

@dsh-external/dsh-message-finder

DSH 会话内消息搜索:搜索历史消息并点击跳转定位(ChatGPT 式小地图)

Source
cransmathenia666-hash
stars
2 stars
License
BSD-3-Clause
Updated
Updated 11 days ago

Readme

# dsh-message-finder

> 长会话动辄上百轮,回找自己说过的一句话只能疯狂滚屏?把会话变成一张小地图,点哪里跳哪里。

ChatGPT-style in-conversation message search for DeepSeek Harness (dsh) Web GUI. 纯前端插件,零 host 依赖。

## 它解决什么问题

用 dsh 写代码、查资料的时候,一个会话会拉得很长。你突然想起「前面是不是提过那个方案」「它当时是怎么回的」,只能手动往上滚,滚半天还容易滚过头。这个插件把当前会话折叠成一张**对话小地图**钉在窗口右缘:

- 一眼看到整场对话的轮廓——按「轮」聚合(你发一条 → agent 整轮回复),不是逐条消息堆砌
- 点任意一条摘要,对话流直接滚动到那条消息并高亮
- 记不清原文?`Ctrl+K` 全文搜索,搜你和助手的每一句话(含 reasoning)

> 📷 演示动图待补充:展开大纲 → 点击某轮 → 对话流跳转高亮(30 秒以内,仓库首页最缺的就是这个)

## 功能

- 🔍 会话内全文搜索:匹配当前会话**已加载窗口**内所有用户消息与助手回复(含 reasoning 内容)
- 🎯 点击即达:选中结果立即滚动定位到对话流对应消息节点,并短暂高亮
- 🗺 常驻消息大纲:右缘一列逐条列出消息摘要,点击直达;可收起成一条带刻度的窄条,刻度也支持点击跳转
- 🧭 回到最新:一键滚回对话最底部
- ⌨️ 快捷键:`Ctrl+K` 开/关搜索,`Esc` 关闭,`↑/↓/Enter` 键盘导航,中文输入法组合键不会误触发
- 🏷 筛选:全部 / 我发的 / 助手回复,排序方向可切换
- 📦 零 host 依赖:数据全部来自客户端会话快照(官方 `ConversationSnapshot`),视觉跟随 DSH 主题令牌,深浅色自动适配

## 安装(原生 dsh 插件)

改造后已是标准的 DSH bundle(`dsh.bundle.patch` + `dsh.client`),直接用官方 `dsh plugin` 命令安装即可,**不再需要任何自定义注入器**。

**方式一:从 Git 仓库安装(推荐)**

```bash
# web 是 Web GUI 的 profile 名
dsh plugin --profile web add git+https://github.com/cransmathenia666-hash/dsh-message-finder.git
```

装完重启 `dsh web`:会话头部出现搜索按钮(`Ctrl+K`),右缘是常驻会话大纲(小地图)。

**方式二:从本地目录安装(开发调试)**

```bash
dsh plugin --profile web add D:/path/to/dsh-message-finder
```

**卸载**

```bash
dsh plugin --profile web remove @dsh-external/dsh-message-finder
```

> 说明:`dsh plugin` 底层用 pnpm 管理。从 Git 安装时若 pnpm 提示某个构建脚本被阻止,把提示里给出的 key 加到 profile 的 `pnpm-workspace.yaml` 的 `allowBuilds` 中再执行一次即可;`prepare` 脚本会自动执行 `npm run build` 产出 `lib/`。当前临时 profile `dshmf-test` 仅用于本地装配验证,可随时 `rm -rf ~/.dsh/profiles/dshmf-test` 移除。

## 它怎么工作的(写给好奇的人)

- 数据:`conversation.session.header.utilities` Slot 的 React 组件通过 `useSession()` 拿到官方 `ConversationSnapshot`,从 `chat.order` + `chat.nodes` 与 `nodes`(UserMessageNode / AssistantMessageNode)构建消息索引(key / kind / seq / time / text),灌入插件自有的共享 store
- 界面:`shell.overlay` Slot 渲染浮层面板,消费 store 做过滤与排序
- 定位:官方 ChatView 每个消息节点带 `data-chat-flow-key` 属性,点击结果后 `scrollIntoView` 并加短暂高亮 class
- 生命周期:全部通过 `ctx.effect` 管理(样式、Slot 注册、快捷键监听),卸载即净

## 已知限制(说实话的时间)

- 索引与搜索范围 = **当前已加载的会话窗口**;更早的历史可通过官方「加载更早」滚动后重建索引,折叠区/窗口外的消息会定位到最近的可见位置并提示
- 当前聚焦单会话内搜索;跨会话全局搜索(host `sessions.search` 索引)是下一步

## 兼容性

- DeepSeek Harness Web GUI(`dsh web`),2026-08 developer preview 版本
- 依赖官方 Slot:`conversation.session.header.utilities` / `shell.overlay`(若未来官方移除这些 seat 需适配)

## License

BSD-3-Clause

Install

dsh plugin --profile web add github:cransmathenia666-hash/dsh-message-finder

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source