All plugins

DSH / BUNDLE / CLIENT-UI

dsh-find-history

v1.0.1sukirk / dsh-find-historye45210e3ed

InstallableBundlesUI & client pluginsCommunity · Topic auto-analysisWeb UI

Overview

dsh-find-history

DSH Web plugin: an inline search box in the sidebar Workspaces header that finds a forgotten conversation by the words you typed in it, across every workspace.

README / EN

Package documentation

Registry summary

DSH Web plugin: an inline search box in the sidebar Workspaces header that finds a forgotten conversation by the words you typed in it, across every workspace.

dsh.pub verifies the pinned bundle contract, runtime facts, and distribution semantics. The complete README remains in the source repository.

Read the full README on GitHub

LIMITATIONS

Known limitations

- 适用于 DSH `0.2.1-rc.x` 的 web profile,需要 Node ≥ 22(用内置 zstd 逐帧解压,不依赖 `zstd` 命令);目前只在 Linux 上实测。 - 侧栏标题行没有公开插槽,入口图标通过注入 DOM 实现。若图标未出现:先刷新页面,再确认侧栏「插件」页里「查找历史」处于启用状态。DSH 侧栏结构变更时这里需要适配。 - 高亮依赖浏览器的 CSS Custom Highlight API(Chromium 105+);不支持时只滚动定位、不高亮。 - 输出池仅收录每轮最终回答,过程消息与工具调用不入库。 - 索引构建时间随会话数线性增长;检索是内存扫描,10 万条消息约 46ms,会话规模增大时检索仍是毫秒级。 <details> <summary><b>实现原理:为什么是毫秒级</b></summary> <img src="docs/flow.png" alt="数据流:会话日志 → 侧车索引 → 内存匹配 → 侧栏面板" width="680"> DSH 将会话写入 `~/.dsh/sessions/<workspace>/<session-id>/session.v4.jsonl.zstd`,为多帧 zstd 拼接格式,无法直接检索。处理流程: 1. 扫描 zstd 帧头(`0x28 0xb5 0x2f 0xfd`)获取帧边界; 2. 逐帧解压后仅解析目标类型的行(`user/message`、`assistant/message`、`session/title`),其余行跳过; 3. 每个会话生成一个侧车文件,记录已读取字节数、帧数、标题与提取出的文本; 4. 日志增长时从上次字节位置续读,仅解压尾部新增帧; 5. 首次安装由子进程分批回填(每批约 12MB,最多 2 个并发 worker); 6. 检索阶段在内存中扫描全部提取文本。 | 实测项 | 结果 | | --- | --- | | 冷建(首次安装) | 142 个会话 / 196MB 约 4.7s;Host 启动 0.3s 后自动开始 | | 再次启动 | 不重建,读取侧车约 3ms | | 会话日志增长 | 仅解压新增帧,约 4ms | | 单次检索(含标题、工作区) | 中位 0.7ms,p95 2.8ms | | 磁盘占用 | 侧车索引约 3MB(不复制日志正文) | 示意图与开发说明见 [CONTRIBUTING.md](CONTRIBUTING.md)。 </details>