dsh-smooth-stream 0.1.0 → 0.3.1
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 +103 -0
- package/README.md +62 -47
- package/lib/client.js +545 -44
- package/lib/client.js.map +1 -1
- package/lib/index.js +229 -0
- package/package.json +25 -3
- package/src/client/SmoothStreamCard.module.css +253 -0
- package/src/client/SmoothStreamCard.tsx +122 -0
- package/src/client/TypewriterAssistantNodeView.tsx +11 -3
- package/src/client/index.ts +96 -3
- package/src/client/locales.ts +74 -0
- package/src/client/smooth-stream-card-controller.ts +162 -0
- package/src/client/smooth-stream-settings-api.ts +65 -0
- package/src/package-meta.ts +39 -0
- package/src/plugin.ts +101 -0
- package/src/profile-installation.ts +121 -0
- package/src/settings-api.ts +33 -0
- package/src/settings.ts +30 -0
- package/README.zh.md +0 -88
package/README.en.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# dsh-smooth-stream
|
|
2
|
+
|
|
3
|
+
English | [中文](README.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 dsh-smooth-stream
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If `dsh` is already on your `PATH`:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
dsh plugin --profile web add dsh-smooth-stream
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The npm package ships prebuilt `lib/`, so no pnpm ≥10 build-script allowance is needed.
|
|
42
|
+
|
|
43
|
+
Start the UI:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
pnpm dsh web
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The Host log should include `[dsh-smooth-stream] plugin loaded!`.
|
|
50
|
+
|
|
51
|
+
Remove it with `pnpm dsh plugin --profile web remove dsh-smooth-stream` (or `dsh plugin --profile web remove dsh-smooth-stream`).
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
The bundle installs with `preset: balanced`. Change it in the profile `cordis.patch.yml` if you want a different cadence:
|
|
56
|
+
|
|
57
|
+
| `preset` | Feel |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `realtime` | Keeps closer to the model |
|
|
60
|
+
| `balanced` | Default |
|
|
61
|
+
| `silky` | More buffer, slower catch-up |
|
|
62
|
+
|
|
63
|
+
`maxScrollSpeedPxPerSec` (default `1000`) is a ceiling so the first large lag does not teleport.
|
|
64
|
+
|
|
65
|
+
## User settings
|
|
66
|
+
|
|
67
|
+
In the Web UI, open **Settings → Plugins → Plugin configuration** to find a **Smooth stream** card with an **"Auto-expand thinking"** toggle:
|
|
68
|
+
|
|
69
|
+
- **On** (default): reasoning blocks auto-expand while streaming and collapse when thinking ends — the plugin's default behavior.
|
|
70
|
+
- **Off**: reasoning blocks stay collapsed; you can still open one by hand, and the stream state will not wrestle it back.
|
|
71
|
+
|
|
72
|
+
This is a durable, user-level preference that applies live without a restart, and is written to the DeepSeek Harness user-settings document rather than the plugin's composed configuration.
|
|
73
|
+
|
|
74
|
+
## About & updates
|
|
75
|
+
|
|
76
|
+
- **Version / homepage / license**: see the top of this page and the `version`, `homepage`, `repository`, and `license` fields in [package.json](package.json). Installed plugins are listed under **Settings → Plugins → All**.
|
|
77
|
+
- **Updates**: the card shows the version loaded by the Host. When the active profile declares `dsh-smooth-stream` as an npm dependency, its **Update** button runs the same fixed package update for that profile and then asks you to restart Harness. A `link:` or `file:` development install is shown as a development version and deliberately leaves the button disabled, so it cannot replace your checkout.
|
|
78
|
+
|
|
79
|
+
You can also update an npm-installed profile from the command line:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
dsh plugin --profile web update dsh-smooth-stream
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
(`dsh plugin --profile web outdated` shows whether a newer version exists.)
|
|
86
|
+
|
|
87
|
+
## FAQ
|
|
88
|
+
|
|
89
|
+
**Is this an official DeepSeek plugin?**
|
|
90
|
+
No. It is a community plugin for the DeepSeek Harness (`dsh`) Web UI, MIT-licensed, and not part of the official DeepSeek distribution.
|
|
91
|
+
|
|
92
|
+
**How do I install a DeepSeek Harness plugin?**
|
|
93
|
+
Use the built-in plugin command: `dsh plugin --profile web add dsh-smooth-stream` from a dsh source checkout (see [Install](#install)).
|
|
94
|
+
|
|
95
|
+
**Can I install it from npm?**
|
|
96
|
+
Yes — `dsh-smooth-stream` is published to [npm](https://www.npmjs.com/package/dsh-smooth-stream). `dsh plugin --profile web add dsh-smooth-stream` installs the prebuilt package.
|
|
97
|
+
|
|
98
|
+
**Does it respect `prefers-reduced-motion`?**
|
|
99
|
+
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.
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
[MIT](LICENSE)
|
package/README.md
CHANGED
|
@@ -1,88 +1,103 @@
|
|
|
1
1
|
# dsh-smooth-stream
|
|
2
2
|
|
|
3
|
-
English
|
|
3
|
+
[English](README.en.md) | 中文
|
|
4
4
|
|
|
5
5
|
[](https://whyihaveyou.github.io/dsh-suite/)
|
|
6
6
|
|
|
7
|
-
**dsh-smooth-stream**
|
|
7
|
+
**dsh-smooth-stream** 是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(`dsh`)的社区插件,给 Web 对话做**丝滑流式渲染**:字跟着模型走、换行滑入、不闪。不是官方发行的一部分。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
项目主页:<https://laplace-bit.github.io/dsh-smooth-stream/>
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 效果
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
左:默认 Web UI。右:dsh-smooth-stream。
|
|
14
14
|
|
|
15
|
-

|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## 它做什么
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
19
|
+
- **揭示跟着模型走。** 助手文本按到达速率出现。突发不会整段倒出来,慢流也不会停住再猛地补上。
|
|
20
|
+
- **一直是 Markdown。** 代码、强调等在流式过程中就按格式渲染,没有先出纯文本再换成排版的交接。
|
|
21
|
+
- **换行是滑进来的。** 新的一行或正在变高的工具卡片会滑入视野,而不是把整段记录往上顶一格。
|
|
22
|
+
- **滚动条归你。** 往上翻看前文时 overlay 会松手。只有回到底部才会继续跟随——点「回到底部」也算。
|
|
23
|
+
- **思考仍是内置那一行。** 推理用原来的 disclosure。它是当前流式尾部时展开,思考一结束就收起;箭头仍可手动开关。
|
|
24
|
+
- **整轮一起动。** 运行中的工具卡片、模型重试、workflow run 共用同一套跟随,所以滑的是整轮回复,不只是助手正文。
|
|
25
|
+
- **该停的时候会停。** `prefers-reduced-motion` 会直接给出全文,也不接管跟随。帧率低于 30 fps 且回复在屏外时,揭示会暂停,画面恢复后再补上。
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## 安装
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
在 DeepSeek Harness 源码仓库里:
|
|
30
30
|
|
|
31
31
|
```sh
|
|
32
|
-
pnpm dsh plugin --profile web add
|
|
32
|
+
pnpm dsh plugin --profile web add dsh-smooth-stream
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
如果 `PATH` 上已经有 `dsh`:
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
|
-
dsh plugin --profile web add
|
|
38
|
+
dsh plugin --profile web add dsh-smooth-stream
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
npm 包带预构建的 `lib/`,无需 pnpm ≥10 的构建脚本授权,直接可装。
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
onlyBuiltDependencies:
|
|
45
|
-
- dsh-smooth-stream
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Then run the same `add` again.
|
|
49
|
-
|
|
50
|
-
Start the UI:
|
|
43
|
+
启动界面:
|
|
51
44
|
|
|
52
45
|
```sh
|
|
53
46
|
pnpm dsh web
|
|
54
47
|
```
|
|
55
48
|
|
|
56
|
-
|
|
49
|
+
Host 日志里应出现 `[dsh-smooth-stream] plugin loaded!`。
|
|
57
50
|
|
|
58
|
-
|
|
51
|
+
卸载:`pnpm dsh plugin --profile web remove dsh-smooth-stream`(或 `dsh plugin --profile web remove dsh-smooth-stream`)。
|
|
59
52
|
|
|
60
|
-
##
|
|
53
|
+
## 配置
|
|
61
54
|
|
|
62
|
-
|
|
55
|
+
组合包默认 `preset: balanced`。要换节拍,在 profile 的 `cordis.patch.yml` 里改:
|
|
63
56
|
|
|
64
|
-
| `preset` |
|
|
57
|
+
| `preset` | 手感 |
|
|
65
58
|
| --- | --- |
|
|
66
|
-
| `realtime` |
|
|
67
|
-
| `balanced` |
|
|
68
|
-
| `silky` |
|
|
59
|
+
| `realtime` | 更贴模型到达 |
|
|
60
|
+
| `balanced` | 默认 |
|
|
61
|
+
| `silky` | 缓冲更大,追上更慢 |
|
|
62
|
+
|
|
63
|
+
`maxScrollSpeedPxPerSec`(默认 `1000`)是速度上限,避免第一次滞后过大时瞬移。
|
|
64
|
+
|
|
65
|
+
## 用户设置
|
|
66
|
+
|
|
67
|
+
在 Web 界面打开 **设置 → 插件 → 插件配置**,会看到一张 **丝滑流式(Smooth stream)** 卡片,可切换**「自动展开思考」**:
|
|
68
|
+
|
|
69
|
+
- **开**(默认):思考块在流式时自动展开,思考结束收起——与插件默认行为一致。
|
|
70
|
+
- **关**:思考块保持折叠;仍可手动点开,且不会被流式状态抢回控制。
|
|
71
|
+
|
|
72
|
+
该设置是用户级的持久化偏好,改完即生效,无需重启;会写进 DeepSeek Harness 的用户设置文档,而不是插件的组合配置。
|
|
73
|
+
|
|
74
|
+
## 关于与更新
|
|
75
|
+
|
|
76
|
+
- **版本 / 主页 / 许可证**:见本页顶部与 [package.json](package.json) 的 `version`、`homepage`、`repository`、`license` 字段;安装的插件列表可在 **设置 → 插件 → 全部** 里查看。
|
|
77
|
+
- **更新**:卡片会显示 Host 当前加载的版本。只有当前 profile 明确把 `dsh-smooth-stream` 声明为 npm 依赖时,**更新**按钮才会对该 profile 执行固定的包更新,并提示重启 Harness。`link:` 或 `file:` 本地开发安装会显示为开发版本,更新按钮会保持禁用,避免覆盖你的源码目录。
|
|
78
|
+
|
|
79
|
+
也可以通过命令行更新 npm 安装的 profile:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
dsh plugin --profile web update dsh-smooth-stream
|
|
83
|
+
```
|
|
69
84
|
|
|
70
|
-
|
|
85
|
+
(也可用 `dsh plugin --profile web outdated` 查看是否有新版本。)
|
|
71
86
|
|
|
72
|
-
##
|
|
87
|
+
## 常见问题
|
|
73
88
|
|
|
74
|
-
|
|
75
|
-
|
|
89
|
+
**这是 DeepSeek 官方插件吗?**
|
|
90
|
+
不是。它是 DeepSeek Harness(`dsh`)Web UI 的社区插件,MIT 协议开源,不属于 DeepSeek 官方发行。
|
|
76
91
|
|
|
77
|
-
**
|
|
78
|
-
|
|
92
|
+
**dsh 插件怎么安装?**
|
|
93
|
+
用内置插件命令:在 dsh 源码目录运行 `dsh plugin --profile web add dsh-smooth-stream`(见[安装](#安装))。
|
|
79
94
|
|
|
80
|
-
|
|
81
|
-
|
|
95
|
+
**能用 npm 安装吗?**
|
|
96
|
+
能。`dsh-smooth-stream` 已发布到 [npm](https://www.npmjs.com/package/dsh-smooth-stream),`dsh plugin --profile web add dsh-smooth-stream` 安装的就是预构建的 npm 包。
|
|
82
97
|
|
|
83
|
-
|
|
84
|
-
|
|
98
|
+
**支持 `prefers-reduced-motion` 吗?**
|
|
99
|
+
支持。系统开启减少动态效果时直接显示完整文本、不接管跟随;帧率低于 30 fps 且回复在屏外时,揭示自动暂停、恢复后再补上。
|
|
85
100
|
|
|
86
|
-
##
|
|
101
|
+
## 许可证
|
|
87
102
|
|
|
88
103
|
[MIT](LICENSE)
|