New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

dsh-anchor-rail

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dsh-anchor-rail

DSH Web 会话锚点导轨插件:左侧导轨展示会话全部用户问题(含压缩前历史),悬浮显示全部锚点名称(与导轨对齐),点击快速跳转。Session anchor rail for DeepSeek Harness Web.

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
27
-38.64%
Maintainers
1
Weekly downloads
 
Created
Source

dsh-anchor-rail

DSH Web 会话锚点导轨插件:长会话快速定位历史问题。

功能

会话锚点导轨

  • 会话聊天区左缘一条固定导轨,展示会话全部用户问题锚点(不随滚动移动,整组上下居中)
  • 悬浮导轨(或任意锚点)→ 导轨右侧展示全部锚点名称,每个名称与对应锚点垂直对齐(#序号 + 问题文本),方便直接阅读问题并选择;移出后自动收起(150ms 宽限)
  • 当前正在阅读的问题对应锚点/名称高亮加长(品牌色),随滚动实时切换
  • 点击锚点或名称跳转到该问题:已渲染的直接滚动定位(与当前判定同参考线,点击谁高亮谁);窗口外的问题自动逐页加载历史后再定位,加载中锚点有脉冲动画
  • 上下文压缩后锚点保留:历史问题锚点不因 compact 而清除,并被标记为「已压缩」(虚线锚点/名称前的灰标签),压缩段与未压缩段一眼可辨
  • 锚点过多时导轨内部滚动并跟随当前锚点,名称列表同步滚动
  • 问题少于 2 个或内容无需滚动时导轨自动隐藏

效果展示

悬浮导轨后,全部锚点名称在导轨右侧按标记位置对齐展开(#序号 + 问题文本),当前阅读的问题高亮:

dsh-anchor-rail 效果展示

安装

方式一:dsh plugin 安装(推荐)

dsh plugin --profile web add dsh-anchor-rail

方式二:profile 本地包

  • 将本仓库放到 ~/.dsh/profiles/web/plugins/dsh-anchor-rail/
  • 在 ~/.dsh/profiles/web/package.json 增加:
"dependencies": {
  "dsh-anchor-rail": "link:plugins\\dsh-anchor-rail"
},
"dsh": {
  "profile": {
    "bundles": [ "...", "dsh-anchor-rail" ]
  }
}
  • 在 profile 目录执行 pnpm install
  • 重启 DSH Web 服务

工作原理

  • Host 半:sessionQuery.readSession 一次性读取会话的完整原始日志(含被折叠替换的历史事件),只取与页面渲染规则一致的提问事件(user/message + surfaceOp: append + source.kind: 'user',即页面上渲染为 user/steering 气泡的行;压缩检查点与注入上下文均排除),提取 {seq, text} 并按 sessionId + 日志尾部 seq 缓存——只有新消息才重读,其余请求均为缓存命中。原始日志只增不减,因此压缩后锚点不会丢失;压缩检查点(surfaceOp: replace + source: {kind:'plugin', plugin:'compact'})的替换区间用于把历史锚点标记为「已压缩」。通过 /dsh-anchor-rail/anchors 路由提供给客户端。
  • Client 半:锚点按序号映射(页面窗口始终是原始日志的连续切片,loadOlder 向前翻页),标记等距分布、上下居中;滚动只扫描已渲染行计算"当前"索引;跳转窗口外问题时循环调用会话 loadOlder()(50 条/页)逐页加载直到目标渲染后定位。

结构

  • lib/index.js — Host 半:锚点数据路由 + 缓存
  • lib/client.js — Client 半(window.__ModuleLoader__ 打包格式):导轨 + 悬浮名称列表
  • cordis.patch.yml — bundle 组合层,插入 anchor-rail 行

License

MIT

Keywords

dsh

FAQs

Package last updated on 25 Aug 2026

Related posts