Laplace-bit/dsh-smooth-stream 预览 preview

Laplace-bit/dsh-smooth-stream

Plugin插件 Native原生 ⭐ 78 MIT Models & Routing模型与路由

DeepSeek Harness (dsh) 插件:丝滑流式呈现,无闪烁。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH) that enhances the AI streaming output experience with smooth, physics-based rendering. To install the plugin, you can run the DSH CLI command dsh plugin --profile web add dsh-smooth-stream from the root of your DSH source directory. Once installed, you can start the DSH web interface with pnpm dsh web and confirm the plugin loaded correctly by checking for the [dsh-smooth-stream] plugin loaded! log entry. It is compatible with all DSH core versions from 0.1.0-rc.5 up to the latest 0.1.2-alpha.3, with compatibility patches for older and newer kernels.

This plugin is designed for DSH users who regularly read long-form AI outputs, such as multi-page code generation or extended logical reasoning chains. After installation, users can access the plugin configuration from the DSH web settings menu, where they can switch between three experience presets: realtime for low-latency output, balanced for a mix of smoothness and speed, and silky for extra-soft rendering. Users can also toggle optional features like logarithmic text fade, automatic folding of thought chains after a turn completes, and a debug HUD for tuning physical parameters. The plugin runs automatically in the background once enabled, so users can just focus on reading rather than chasing jumping text.

This plugin is released under the permissive MIT open source license, so it is free to use, modify, and redistribute for both personal and commercial purposes. The core bundled code is only 4.7KB after Gzip compression, so it adds negligible overhead to DSH’s runtime performance. All changes are tested against an automated test suite that checks for common issues like viewport overflow, tail line jitter, and rendering smoothness across multiple output scenarios. First-time users do not need any extra dependencies beyond a working DSH installation, and the plugin can be removed at any time with the DSH CLI uninstall command.

这是一款专为DeepSeek Harness(DSH)打造的原生插件,核心功能是为AI大模型的流式输出提供丝滑流畅的渲染体验。它采用二阶弹簧物理引擎,将内容渲染和视口滚动拆分为独立的状态机,逐帧平滑推进,消除了大段文本突然弹出、滚动抖动重排等常见问题,给用户带来连贯无视觉负担的阅读质感。它可以通过DSH官方插件命令直接安装,兼容多个版本的DSH内核。

该插件面向经常需要阅读AI长文本输出的DSH用户,尤其适合处理大段代码生成、逻辑推演等场景,这类场景下原生渲染往往会出现频繁的视觉跳跃和滚动抖动。安装完成后,用户可以在DSH的Web界面插件设置中调整参数,选择实时、均衡、丝滑三种不同的手感预设,也可以自定义开启或关闭对数淡入、自动折叠等功能。

本插件采用MIT许可证开源,免费供个人和商业使用,核心编译产物经Gzip压缩后仅约4.7KB,几乎不会给DSH带来额外的性能负担。开发团队已经通过自动化测试框架验证了插件在多种输出场景下的稳定性和兼容性,覆盖流式渲染、视口溢出等多个测试项目。首次使用仅需通过DSH CLI命令安装,重启DSH Web界面即可生效,后续也随时可以卸载或调整配置。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 no risk signal found未发现风险信号
  • This site's static screen found no obvious risk signal (stars, license, activity, manifest)本站静态筛查没发现明显风险信号(星标、许可证、更新活跃度、清单完整度)
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-smooth-stream

把 Laplace-bit/dsh-smooth-stream 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-smooth-stream

让 AI 的长篇生成如提词器般温润流淌。
为 DeepSeek Harness(dsh)打造的二阶弹簧物理流式渲染与零重排跟随引擎。

English · 项目主页 · 工作原理与基准 · npm


极致丝滑的阅读手感

无论是阅读数百行的长篇推演,还是紧盯高速吐字的代码生成,dsh-smooth-stream 带来的是一种沉浸、连贯且零视觉负担的阅读质感:

  • 如水流般自然铺展:告别大段文本突然“砸”在屏幕上的视觉压迫,字句如打字机般富有呼吸感地逐字涌现;
  • 视线无需追赶跳动:视口如同搭载了高精度阻尼滑轨,随文字增长平稳匀速推移,彻底终结换行时的突发踢移;
  • 呼吸感与实时性的平衡:慢速输出时从容优雅,高并发爆发时平稳追赶,无论模型吐字多快,画面始终从容自若。

为什么需要它?

大模型输出是通过网络分块到达的。一个数据包可能在几毫秒内送达数百字符,下一个分块却需要数十毫秒。

如果直接将 DOM 渲染和视口滚动绑定在离散的到达事件上,通常会引发两个阅读体验问题:

  1. 视觉跳跃与撕裂:段落、代码块和表格整段突发呈现,视线被迫频繁重新寻焦;
  2. 滚动抖动与重排风暴:依靠 scrollTop = scrollHeight 进行瞬时硬跳;即使用 CSS scroll-behavior: smooth,高频写入也会不断重置缓动曲线,导致动画永远无法收敛,高速流下伴随剧烈的主线程重排。

dsh-smooth-stream 将内容呈现与视口运动拆分为两个独立的物理状态机,在每一帧动画回调(rAF)中连续积分,彻底消除跳跃感。


核心机理与架构

[ 模型 SSE 分块流 ]
         │
         ▼
 ┌─────────────────┐       背压阻尼 (0.55x ~ 1.0x)       ┌─────────────────┐
 │   揭示节奏引擎   │ ◄──────────────────────────────── │   弹簧跟随引擎   │
 │ (Reveal Engine) │                                   │ (Follow Engine) │
 └────────┬────────┘                                   └────────┬────────┘
          │ 字符积压与分数积分                                      │ 二阶阻尼弹簧积分 (k=130, c=24)
          ▼                                                     ▼
 [ 逐帧平滑展开 DOM ] ───────────────────────────────► [ 合成层 Transform 补偿 ]
  (单帧视觉位移 ≤ 8px)                                   (0 Reflow / 纯 GPU 合成)

1. 动态自适应的揭示引擎(Reveal Engine)

  • 分数级字符积分:根据积压队列深度自适应调节速度($v = 90 + \text{backlog}^{1.25} \times P$),低负载时从容自然,高积压时平稳追赶,绝不倾泻整段文本。
  • 折行限幅平滑:长文本和代码块发生换行时,单帧视觉位移被限制在 8px 以内,将原本 24~28px 的单帧跳跃平摊至数帧完成。
  • 尾部平稳收束:回合结束标记到达后,残余缓冲区以恒定速率释放,正文、思考链与工具调用之间自然衔接。

2. 纯合成层驱动的跟随引擎(Follow Engine)

  • 二阶阻尼物理系统:采用 $k=130, c=24, m=1$ 的亚步进物理弹簧,将内容高度的变化转化为平滑连续的速度与位移轨迹。
  • 零重排(Zero-Reflow)位移补偿:真实滚动容器始终锚定在底部,剩余的视觉滞后完全由外层 DOM 的 transform: translate3d 吸收。跟随过程不读写任何触发 Layout 的属性,杜绝重排风暴。
  • 闭环背压控制(Closed-Loop Backpressure):当跟随滞后接近预留空间时,反向向揭示引擎施加阻尼(最低降至 0.55 倍速),防止文本增长超出视口弹簧范围。
  • 掉帧自愈与跨刷新率一致:主线程卡顿(Stall)时自动钳位物理时间($\le 32\text{ms}$),避免画面恢复后的突进瞬移;在 60Hz 与 120Hz(ProMotion)屏幕下拥有近乎一致的物理收敛时间。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-better-display 下一个 Next opencontext →