dsh-smooth-stream 0.1.0
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/LICENSE +21 -0
- package/README.md +88 -0
- package/README.zh.md +88 -0
- package/cordis.patch.yml +10 -0
- package/lib/client.js +1288 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +73 -0
- package/package.json +135 -0
- package/src/boot-config.ts +28 -0
- package/src/client/AnimatedDisclosure.tsx +85 -0
- package/src/client/FollowHost.tsx +21 -0
- package/src/client/TypewriterAssistantNodeView.module.css +240 -0
- package/src/client/TypewriterAssistantNodeView.tsx +319 -0
- package/src/client/TypewriterToolNodeView.tsx +54 -0
- package/src/client/index.ts +122 -0
- package/src/client/teleprompterGlide.ts +426 -0
- package/src/client/useFpsGuard.ts +84 -0
- package/src/client/useSmoothStreamContent.ts +468 -0
- package/src/config.ts +50 -0
- package/src/css-modules.d.ts +9 -0
- package/src/index.ts +2 -0
- package/src/plugin.ts +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Laplace-bit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# dsh-smooth-stream
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
[](https://whyihaveyou.github.io/dsh-suite/)
|
|
6
|
+
|
|
7
|
+
**dsh-smooth-stream** is a [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`) community plugin for **silky streaming** in the Web UI: arrival-tracking typewriter reveal, glide-in wraps, no flicker. It is not part of the official DeepSeek distribution.
|
|
8
|
+
|
|
9
|
+
Project homepage: <https://laplace-bit.github.io/dsh-smooth-stream/>
|
|
10
|
+
|
|
11
|
+
## Preview
|
|
12
|
+
|
|
13
|
+
Left: default Web UI. Right: dsh-smooth-stream.
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## What it does
|
|
18
|
+
|
|
19
|
+
- **Reveal tracks the model.** Assistant text appears at a cadence that follows the arrival rate. Fast bursts do not dump a whole paragraph; a slow stream does not sit still and then jump.
|
|
20
|
+
- **Markdown stays markdown.** Code, emphasis, and the rest render while the reply is still coming. There is no plain-text tail that later swaps into formatted markdown.
|
|
21
|
+
- **Wraps glide in.** A new line or a growing tool card eases into view instead of snapping the transcript up by a line.
|
|
22
|
+
- **You keep the scroll.** Scroll up to read earlier text and the overlay lets go. Follow resumes only when you return to the bottom — the to-bottom button counts.
|
|
23
|
+
- **Think stays the built-in row.** Reasoning uses the usual disclosure. It opens while thinking is the live tail and closes when thinking ends; the chevron still toggles by hand.
|
|
24
|
+
- **The rest of the turn moves with it.** Running tool cards, model retries, and workflow runs share the same follow, so the whole turn slides instead of only the assistant text.
|
|
25
|
+
- **It backs off when it should.** `prefers-reduced-motion` shows the finished text at once and does not take follow. If the frame rate drops below 30 fps and the reply is off-screen, reveal pauses and catches up when the view is healthy again.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
From a DeepSeek Harness source checkout:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
pnpm dsh plugin --profile web add github:Laplace-bit/dsh-smooth-stream
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If `dsh` is already on your `PATH`:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
dsh plugin --profile web add github:Laplace-bit/dsh-smooth-stream
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The first `add` is expected to fail. Git install has to run this package's `prepare` script, and pnpm ≥10 blocks that until you allow it. Open `~/.dsh/profiles/web/pnpm-workspace.yaml` and add the snippet pnpm printed. On current pnpm that is:
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
onlyBuiltDependencies:
|
|
45
|
+
- dsh-smooth-stream
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Then run the same `add` again.
|
|
49
|
+
|
|
50
|
+
Start the UI:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
pnpm dsh web
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The Host log should include `[dsh-smooth-stream] plugin loaded!`.
|
|
57
|
+
|
|
58
|
+
Remove it with `pnpm dsh plugin --profile web remove dsh-smooth-stream` (or `dsh plugin --profile web remove dsh-smooth-stream`).
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
The bundle installs with `preset: balanced`. Change it in the profile `cordis.patch.yml` if you want a different cadence:
|
|
63
|
+
|
|
64
|
+
| `preset` | Feel |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| `realtime` | Keeps closer to the model |
|
|
67
|
+
| `balanced` | Default |
|
|
68
|
+
| `silky` | More buffer, slower catch-up |
|
|
69
|
+
|
|
70
|
+
`maxScrollSpeedPxPerSec` (default `1000`) is a ceiling so the first large lag does not teleport.
|
|
71
|
+
|
|
72
|
+
## FAQ
|
|
73
|
+
|
|
74
|
+
**Is this an official DeepSeek plugin?**
|
|
75
|
+
No. It is a community plugin for the DeepSeek Harness (`dsh`) Web UI, MIT-licensed, and not part of the official DeepSeek distribution.
|
|
76
|
+
|
|
77
|
+
**How do I install a DeepSeek Harness plugin?**
|
|
78
|
+
Use the built-in plugin command: `dsh plugin --profile web add github:Laplace-bit/dsh-smooth-stream` from a dsh source checkout (see [Install](#install) for the pnpm ≥10 build-script note).
|
|
79
|
+
|
|
80
|
+
**Can I install it from npm?**
|
|
81
|
+
Not yet - the plugin currently installs from GitHub. Watch this repository for npm availability.
|
|
82
|
+
|
|
83
|
+
**Does it respect `prefers-reduced-motion`?**
|
|
84
|
+
Yes. With reduced motion enabled the finished text is shown at once and the plugin does not take over follow. If the frame rate drops below 30 fps while the reply is off-screen, reveal pauses and catches up later.
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
[MIT](LICENSE)
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# dsh-smooth-stream
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
[](https://whyihaveyou.github.io/dsh-suite/)
|
|
6
|
+
|
|
7
|
+
**dsh-smooth-stream** 是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(`dsh`)的社区插件,给 Web 对话做**丝滑流式渲染**:字跟着模型走、换行滑入、不闪。不是官方发行的一部分。
|
|
8
|
+
|
|
9
|
+
项目主页:<https://laplace-bit.github.io/dsh-smooth-stream/>
|
|
10
|
+
|
|
11
|
+
## 效果
|
|
12
|
+
|
|
13
|
+
左:默认 Web UI。右:dsh-smooth-stream。
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## 它做什么
|
|
18
|
+
|
|
19
|
+
- **揭示跟着模型走。** 助手文本按到达速率出现。突发不会整段倒出来,慢流也不会停住再猛地补上。
|
|
20
|
+
- **一直是 Markdown。** 代码、强调等在流式过程中就按格式渲染,没有先出纯文本再换成排版的交接。
|
|
21
|
+
- **换行是滑进来的。** 新的一行或正在变高的工具卡片会滑入视野,而不是把整段记录往上顶一格。
|
|
22
|
+
- **滚动条归你。** 往上翻看前文时 overlay 会松手。只有回到底部才会继续跟随——点「回到底部」也算。
|
|
23
|
+
- **思考仍是内置那一行。** 推理用原来的 disclosure。它是当前流式尾部时展开,思考一结束就收起;箭头仍可手动开关。
|
|
24
|
+
- **整轮一起动。** 运行中的工具卡片、模型重试、workflow run 共用同一套跟随,所以滑的是整轮回复,不只是助手正文。
|
|
25
|
+
- **该停的时候会停。** `prefers-reduced-motion` 会直接给出全文,也不接管跟随。帧率低于 30 fps 且回复在屏外时,揭示会暂停,画面恢复后再补上。
|
|
26
|
+
|
|
27
|
+
## 安装
|
|
28
|
+
|
|
29
|
+
在 DeepSeek Harness 源码仓库里:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
pnpm dsh plugin --profile web add github:Laplace-bit/dsh-smooth-stream
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
如果 `PATH` 上已经有 `dsh`:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
dsh plugin --profile web add github:Laplace-bit/dsh-smooth-stream
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
第一次 `add` 失败是正常的。git 安装需要跑这个包的 `prepare` 脚本,pnpm ≥10 在你授权之前会拦截。打开 `~/.dsh/profiles/web/pnpm-workspace.yaml`,把 pnpm 打印的那段加进去。当前 pnpm 打印的是:
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
onlyBuiltDependencies:
|
|
45
|
+
- dsh-smooth-stream
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
然后重新执行同一条 `add`。
|
|
49
|
+
|
|
50
|
+
启动界面:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
pnpm dsh web
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Host 日志里应出现 `[dsh-smooth-stream] plugin loaded!`。
|
|
57
|
+
|
|
58
|
+
卸载:`pnpm dsh plugin --profile web remove dsh-smooth-stream`(或 `dsh plugin --profile web remove dsh-smooth-stream`)。
|
|
59
|
+
|
|
60
|
+
## 配置
|
|
61
|
+
|
|
62
|
+
组合包默认 `preset: balanced`。要换节拍,在 profile 的 `cordis.patch.yml` 里改:
|
|
63
|
+
|
|
64
|
+
| `preset` | 手感 |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| `realtime` | 更贴模型到达 |
|
|
67
|
+
| `balanced` | 默认 |
|
|
68
|
+
| `silky` | 缓冲更大,追上更慢 |
|
|
69
|
+
|
|
70
|
+
`maxScrollSpeedPxPerSec`(默认 `1000`)是速度上限,避免第一次滞后过大时瞬移。
|
|
71
|
+
|
|
72
|
+
## 常见问题
|
|
73
|
+
|
|
74
|
+
**这是 DeepSeek 官方插件吗?**
|
|
75
|
+
不是。它是 DeepSeek Harness(`dsh`)Web UI 的社区插件,MIT 协议开源,不属于 DeepSeek 官方发行。
|
|
76
|
+
|
|
77
|
+
**dsh 插件怎么安装?**
|
|
78
|
+
用内置插件命令:在 dsh 源码目录运行 `dsh plugin --profile web add github:Laplace-bit/dsh-smooth-stream`(pnpm ≥10 的构建授权说明见[安装](#安装))。
|
|
79
|
+
|
|
80
|
+
**能用 npm 安装吗?**
|
|
81
|
+
暂时不能,目前只支持从 GitHub 安装。可以关注本仓库,npm 发布后会有通知。
|
|
82
|
+
|
|
83
|
+
**支持 `prefers-reduced-motion` 吗?**
|
|
84
|
+
支持。系统开启减少动态效果时直接显示完整文本、不接管跟随;帧率低于 30 fps 且回复在屏外时,揭示自动暂停、恢复后再补上。
|
|
85
|
+
|
|
86
|
+
## 许可证
|
|
87
|
+
|
|
88
|
+
[MIT](LICENSE)
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Applied when this package appears in a profile's dsh.profile.bundles list.
|
|
2
|
+
- insert:
|
|
3
|
+
- id: smooth-stream
|
|
4
|
+
name: dsh-smooth-stream
|
|
5
|
+
config:
|
|
6
|
+
mode: typewriter
|
|
7
|
+
preset: balanced
|
|
8
|
+
revealCharsPerSec: 80
|
|
9
|
+
scrollSpeedPxPerSec: 48
|
|
10
|
+
maxScrollSpeedPxPerSec: 1000
|