dsh-smooth-stream 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +12 -10
- package/README.md +12 -10
- package/lib/client.js +1140 -347
- package/lib/client.js.map +1 -1
- package/package.json +3 -1
- package/src/client/FollowHost.tsx +49 -4
- package/src/client/TypewriterAssistantNodeView.module.css +3 -2
- package/src/client/TypewriterAssistantNodeView.tsx +160 -23
- package/src/client/TypewriterToolNodeView.tsx +183 -8
- package/src/client/index.ts +25 -8
- package/src/client/teleprompterGlide.ts +763 -213
- package/src/client/useProgressiveDomText.ts +206 -0
- package/src/client/useSmoothStreamContent.ts +139 -73
- package/src/config.ts +3 -6
package/README.en.md
CHANGED
|
@@ -14,15 +14,17 @@ Left: default Web UI. Right: dsh-smooth-stream.
|
|
|
14
14
|
|
|
15
15
|

|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **The
|
|
25
|
-
- **
|
|
17
|
+
## Current behavior
|
|
18
|
+
|
|
19
|
+
- **The whole Agent turn uses one extensible pipeline.** Assistant text, Think, Context, Retry, Command, Bash, Glob, Read, tool calls, and newly registered renderers all enter progressive reveal and bottom-follow through the same boundary, without a tool-name allowlist.
|
|
20
|
+
- **Reveal speed adapts to queue pressure.** Small updates keep a soft cadence while large or fast bursts catch up promptly. Once the producer completes, remaining source is committed immediately instead of continuing to type long after the Agent has stopped.
|
|
21
|
+
- **Markdown remains mounted throughout streaming.** Code blocks, tables, emphasis, and other formatting do not begin as plain text and later swap trees. Historical messages also do not replay their reveal animation when remounted.
|
|
22
|
+
- **Scroll room opens only when a wrap is actually likely.** The predictor combines buffered source with the current line's remaining width before opening its runway. Long replies still absorb line wraps smoothly, while a short same-line answer after Think does not pre-scroll and rebound.
|
|
23
|
+
- **Conversation chrome stays fixed.** `Deep diving...`, the composer, and the to-bottom button never ride the message transform. Fast output and low-frame-rate catch-up cannot paint through the status row or disappear behind the composer.
|
|
24
|
+
- **One continuous spring owns motion.** The engine carries velocity and displacement between frames instead of repeatedly starting native smooth-scroll calls. Line wraps, code, tables, and growing tool rows converge along the same trajectory; completion lands on the natural floor and retires temporary state without a flash or overshoot rebound.
|
|
25
|
+
- **Reader input wins immediately.** A small upward wheel, touch, or keyboard gesture releases automatic follow. Ownership returns only after the reader actually reaches the bottom again.
|
|
26
|
+
- **Think respects the user's preference.** With auto-expand enabled it keeps the Harness disclosure interaction and collapses when thinking ends. With it disabled, collapsed reasoning can keep updating without fake height motion, and a manual toggle is not wrestled back by stream state.
|
|
27
|
+
- **Performance guards preserve the final position.** `prefers-reduced-motion` shows complete content without taking follow. Off-screen DOM commits pause under low FPS, then catch up under control and still finish exactly at the bottom.
|
|
26
28
|
|
|
27
29
|
## Install
|
|
28
30
|
|
|
@@ -60,7 +62,7 @@ The bundle installs with `preset: balanced`. Change it in the profile `cordis.pa
|
|
|
60
62
|
| `balanced` | Default |
|
|
61
63
|
| `silky` | More buffer, slower catch-up |
|
|
62
64
|
|
|
63
|
-
`
|
|
65
|
+
Legacy `mode`, `revealCharsPerSec`, `scrollSpeedPxPerSec`, and `maxScrollSpeedPxPerSec` fields are still accepted so existing profiles keep loading; the current adaptive engine uses only `preset` to tune cadence.
|
|
64
66
|
|
|
65
67
|
## User settings
|
|
66
68
|
|
package/README.md
CHANGED
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
|
|
15
15
|

|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
17
|
+
## 当前实现
|
|
18
|
+
|
|
19
|
+
- **整轮 Agent 输出统一接管。** 助手正文、Think、Context、Retry、Command、Bash、Glob、Read、工具调用以及后续注册的新渲染器,都通过同一个可扩展入口进入渐进揭示和底部跟随,不依赖工具名称白名单。
|
|
20
|
+
- **吐字速度会跟随积压自动变速。** 小批内容保持柔和节拍,大批或高速到达时及时追赶;完成信号到达后立即提交剩余正文,不让 Agent 已结束而文字还长时间继续输出。
|
|
21
|
+
- **流式过程始终使用 Markdown 渲染。** 代码块、表格、强调等不会先显示成纯文本再整体换树,历史消息也不会在重新挂载时重播动画。
|
|
22
|
+
- **换行前才准备滚动空间。** 引擎结合待揭示内容和当前行剩余宽度判断是否可能增高,只在真实换行风险出现时打开预测 runway。长回复仍能平滑吸收换行,Think 后的短同一行正文不会多滚再回弹。
|
|
23
|
+
- **状态区域保持稳定。** `Deep diving...`、输入框和「滚动到底部」按钮不参与消息 transform;高速输出或低帧率下,正文也不会越过状态区域或藏到输入框后面。
|
|
24
|
+
- **滚动使用持续弹簧而不是反复启动原生平滑滚动。** 每帧保留速度和位移状态,换行、代码块、表格及工具卡片增高都沿同一轨迹收敛;结束时落在自然底部并安静撤销临时状态,不闪烁、不越位回弹。
|
|
25
|
+
- **用户输入拥有最高优先级。** 向上滚轮、触控拖动或键盘滚动会在轻微手势时立即解除自动跟随;只有用户真正回到底部后才重新接管。
|
|
26
|
+
- **Think 尊重用户设置。** 自动展开开启时沿用 Harness 的 disclosure 交互并在思考结束后收起;关闭时折叠内容持续更新但不引发虚假高度和上下闪动,手动展开也不会被流状态抢回。
|
|
27
|
+
- **性能保护不会破坏最终状态。** `prefers-reduced-motion` 直接显示完整内容且不接管跟随;低帧率且回复在屏外时暂停 DOM 提交,恢复后受控追赶,最终仍准确停在底部。
|
|
26
28
|
|
|
27
29
|
## 安装
|
|
28
30
|
|
|
@@ -60,7 +62,7 @@ Host 日志里应出现 `[dsh-smooth-stream] plugin loaded!`。
|
|
|
60
62
|
| `balanced` | 默认 |
|
|
61
63
|
| `silky` | 缓冲更大,追上更慢 |
|
|
62
64
|
|
|
63
|
-
`maxScrollSpeedPxPerSec
|
|
65
|
+
旧版的 `mode`、`revealCharsPerSec`、`scrollSpeedPxPerSec` 和 `maxScrollSpeedPxPerSec` 字段仍可被加载,以兼容已有 profile;当前自适应引擎仅使用 `preset` 调整节拍。
|
|
64
66
|
|
|
65
67
|
## 用户设置
|
|
66
68
|
|