dsh-auto-collapse 0.1.8 → 0.2.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 +53 -68
- package/README.md +64 -68
- package/assets/screenshot.png +0 -0
- package/lib/client.js +843 -2339
- package/lib/index.js +4 -46
- package/lib/types/controller.d.ts +50 -0
- package/lib/types/dom-view.d.ts +36 -0
- package/lib/types/fold.d.ts +2 -323
- package/lib/types/host-contract.d.ts +17 -0
- package/lib/types/index.d.ts +12 -11
- package/lib/types/scheduler.d.ts +10 -0
- package/lib/types/status-text.d.ts +14 -0
- package/lib/types/summary.d.ts +17 -0
- package/lib/types/work-groups.d.ts +30 -0
- package/lib/types/work-info.d.ts +4 -0
- package/lib/types/work-model.d.ts +24 -0
- package/package.json +14 -3
package/README.en.md
CHANGED
|
@@ -1,111 +1,96 @@
|
|
|
1
1
|
# dsh-auto-collapse
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> DSH Web workflow folding: keep the native turn disclosure, combine thinking, tools and context between prose into one second-level summary, and reveal the original rows when expanded.
|
|
4
4
|
>
|
|
5
|
-
>
|
|
6
|
-
>
|
|
7
|
-
> This plugin is listed in the Plugin marketplace: [marketplace link](https://www.dsh.so/artifact/dsh-auto-collapse/)
|
|
8
|
-
|
|
9
|
-
## What it does
|
|
5
|
+
> [中文](README.md) · [Plugin marketplace](https://www.dsh.so/artifact/dsh-auto-collapse/)
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
## Interaction
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
```text
|
|
10
|
+
Prose A
|
|
11
|
+
▸ Thought · Used the browser · Added context · Edited files
|
|
12
|
+
Prose B
|
|
13
|
+
▸ Running npm run check
|
|
14
|
+
Prose C
|
|
15
|
+
```
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
Each interval has one summary. Switching from thinking to a tool or adding context extends that interval. New prose closes it; later work starts another interval. A single work item also forms a group.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
- **Level 1 belongs to DSH:** completed-turn folding, counts and final-answer visibility.
|
|
20
|
+
- **Level 2 belongs to this plugin:** one mixed-work summary between prose fragments, during streaming and after reopening the native turn.
|
|
21
|
+
- **Level 3 stays native:** thinking, tool and context rows in their original order, retaining their own disclosure state.
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
- **Second-level rows**: after expanding level one, tool-call groups and think blocks each collapse into a single chip row (`正在运行 {command}` / `运行了命令` / `已思考`), click to expand/collapse; adjacent tool groups merge, while body text serves as a hard boundary (never merged across).
|
|
21
|
-
- **Third-level think merge**: expanding `已思考` shows consecutive think rows merged into one row titled `Think · first line`, click to reveal the merged content block; raw fourth-level rows never appear.
|
|
22
|
-
- **Native visual alignment**: 16px icon box / 14px glyph / 24px line height / 16px row gap; colors use DSH native tokens (`--dsw-alias-label-*`); think and command icons come from DSH native icons (`IconThinkOutline14` / `IconApiOutline14`).
|
|
23
|
-
- **Stream-friendly**: in-place `assistant-step` body updates, React node replacement, and out-of-order history mounting are reconciled on every pass; running rows use a smooth text pulse motion, disabled by `prefers-reduced-motion`.
|
|
24
|
-
- **Complete work-node coverage**: top-level `command` / `manual-compaction`, context nodes, and image-only finals follow the same turn semantics as tool calls.
|
|
25
|
-
- **Configurable status text**: in Settings → Plugins → Plugin configuration, edit the status prompt (default `Deep sleeping...`); leaving it blank restores the official copy (“深度求索中...” in current builds). The host-appended elapsed suffix (e.g. `33秒`) is preserved.
|
|
26
|
-
- **Fully reversible**: uninstalling (HMR stop) restores every collapsed/hidden/rewritten node.
|
|
23
|
+

|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
The preview is a browser acceptance fixture using native DSH 0.1.2-rc.1 disclosure, reasoning and turn-process components.
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
|---|---|
|
|
32
|
-
| 0.1.8 | **DSH 0.1.2-rc.1+** (reconnectable settings lifecycle, native turn-process rows, Chinese status copy) |
|
|
33
|
-
| 0.1.7 | DSH 0.1.2-rc.1+ (initial support; the settings card can be absent under startup races, so upgrade to 0.1.8) |
|
|
34
|
-
| ≤ 0.1.6 | DSH 0.1.1.x |
|
|
27
|
+
## Behavior
|
|
35
28
|
|
|
36
|
-
|
|
29
|
+
Prose is a hard grouping boundary, including thinking/prose/thinking inside a single `assistant-step`. Markdown line breaks do not create groups. Images, SVG and other answer content remain native. Groups never cross user/steering messages, turns or unknown semantic surfaces.
|
|
37
30
|
|
|
38
|
-
|
|
31
|
+
Closing native Level 1 hides its groups without discarding their expansion state. Context outside the native process range keeps an accessible Level 2 entry; opening it can also open the native turn. Level 2 remains available in native Normal mode.
|
|
39
32
|
|
|
33
|
+
System prompts join the adjacent context work group. A prompt with an explicit turn owner follows that native Level 1 disclosure. Reopening Level 1 shows Level 2 first; opening Level 2 reveals the original system-prompt row with its detail state preserved.
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
Summaries describe actions and current activity; they never replace full reasoning content. `hidden="until-found"` and `beforematch` preserve browser search. Selection, focus and pending user input stay accessible. Session changes, HMR and error recovery restore plugin-controlled attributes without overwriting later host changes.
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
dsh plugin --profile web add "dsh-auto-collapse"
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Install from GitHub when using the development version or following `main`:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
dsh plugin --profile web add "github:a179-sanae/dsh-auto-collapse#main"
|
|
51
|
-
```
|
|
37
|
+
The optional status-text setting remains available under Settings → Plugins → Plugin configuration. It defaults to `Deep sleeping...`; saving an empty string restores the official wording while preserving elapsed-time suffixes. Its lifecycle is independent of grouping.
|
|
52
38
|
|
|
53
|
-
|
|
39
|
+
## Compatibility and migration
|
|
54
40
|
|
|
55
|
-
|
|
41
|
+
| Plugin | Verified DSH |
|
|
42
|
+
|---|---|
|
|
43
|
+
| 0.2.x | 0.1.2-rc.1; browser tests include its native widget code |
|
|
44
|
+
| 0.1.8 | 0.1.2-rc.1, legacy implementation |
|
|
45
|
+
| ≤ 0.1.6 | 0.1.1.x |
|
|
56
46
|
|
|
57
|
-
|
|
47
|
+
0.2.0 rewrites the folding engine. It retains mixed-work Level 2, removes the custom processed-time Level 1 and copied reasoning-body layer, and includes context in its surrounding group. Existing `statusText` configuration is preserved. Unrecognized DOM nodes remain visible; other host versions need separate validation.
|
|
58
48
|
|
|
59
|
-
|
|
60
|
-
src/fold.ts core: FoldController (state machine) + findBlocks (block recognition) + collapse/expand logic
|
|
61
|
-
src/client.ts browser entry (plugin registration)
|
|
62
|
-
src/index.ts host half (host-side entry)
|
|
63
|
-
build.mjs build script (generates lib/client.js, lib/index.js, and lib/types/*)
|
|
64
|
-
tsconfig.build.json TypeScript declaration build configuration
|
|
65
|
-
deploy.mjs safe deploy: validate → back up → replace → verified restart → hash check/rollback; Windows uses PowerShell, Linux/macOS use lsof + ps
|
|
66
|
-
cordis.patch.yml profile tree mounting
|
|
67
|
-
test/ fake-DOM contract, race, session-switch, and 40-order permutation regressions
|
|
68
|
-
```
|
|
49
|
+
## Install
|
|
69
50
|
|
|
70
|
-
|
|
51
|
+
To install the published release:
|
|
71
52
|
|
|
72
53
|
```bash
|
|
73
|
-
|
|
54
|
+
dsh plugin --profile web add dsh-auto-collapse
|
|
74
55
|
```
|
|
75
56
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
### Quick deploy (local dev)
|
|
57
|
+
To install from source, build a complete tarball and install the generated path:
|
|
79
58
|
|
|
80
59
|
```bash
|
|
81
|
-
npm
|
|
60
|
+
npm ci
|
|
61
|
+
npm run package
|
|
62
|
+
dsh plugin --profile web add <absolute-path-to-generated-tgz>
|
|
82
63
|
```
|
|
83
64
|
|
|
84
|
-
|
|
65
|
+
Reload the plugin or restart the host Web app, then refresh the page. Roll back by installing a complete previous package, such as `dsh-auto-collapse@0.1.8`.
|
|
85
66
|
|
|
86
|
-
|
|
67
|
+
`npm run package` and its compatibility alias `npm run deploy` **only produce a tarball**. They no longer replace installed files individually, read credentials or stop/restart DSH.
|
|
87
68
|
|
|
88
|
-
|
|
69
|
+
## Development
|
|
70
|
+
|
|
71
|
+
Node.js 22+. Install Playwright Chromium once; Windows can also use an installed Chrome/Edge. Override the executable with `DSH_TEST_BROWSER` if needed.
|
|
89
72
|
|
|
90
73
|
```bash
|
|
91
|
-
npm
|
|
74
|
+
npm ci
|
|
75
|
+
npx playwright install chromium
|
|
76
|
+
npm run check
|
|
92
77
|
```
|
|
93
78
|
|
|
94
|
-
|
|
79
|
+
Linux CI uses `npx playwright install --with-deps chromium`.
|
|
95
80
|
|
|
96
81
|
```bash
|
|
97
|
-
npm
|
|
82
|
+
npm run test:unit
|
|
83
|
+
npm run test:browser
|
|
84
|
+
npm run preview # http://127.0.0.1:43190
|
|
85
|
+
npm run package # complete tarball in artifacts/
|
|
98
86
|
```
|
|
99
87
|
|
|
100
|
-
|
|
88
|
+
Build after source changes before standalone browser testing or refreshing the preview. `npm run check` runs typechecking, a fresh build, unit tests, browser tests and package smoke tests.
|
|
101
89
|
|
|
102
|
-
|
|
90
|
+
Browser tests use real React, captured native widget implementations and the current client bundle. They cover mixed groups, inline prose boundaries, native turns, details, search, focus, SVG, recovery, settings and 100/1,000/5,000 historical nodes. The complete suite includes a 30-second idle check. Fixtures use synthetic content without personal sessions or credentials; they do not validate an entire backend deployment.
|
|
103
91
|
|
|
104
|
-
|
|
105
|
-
- **Segment reconciliation**: every pass rebuilds segments from current DOM order. The last `assistant-step` containing text or media is final; earlier bodies are intermediate work. Stable flow/node keys preserve UI state without one-shot mutation bookkeeping.
|
|
106
|
-
- **Duration**: streaming segments each track their own first running observation; historical segments parse official duration or the `timeStart`/turn-tail range. Whole minutes omit the seconds field.
|
|
107
|
-
- **React coexistence and reversibility**: replaced nodes rebind by stable key, removed level-one rows rebuild with their expansion state, and every inline `display` value is saved before mutation and restored exactly.
|
|
92
|
+
The implementation separates host recognition, ordered work modeling, pure grouping/state, summaries, DOM rendering, scheduling and optional status text. It never copies message bodies, reparents native nodes, replaces the host renderer, infers a final answer, cleans arbitrary empty elements or writes the main scroll position.
|
|
108
93
|
|
|
109
94
|
## License
|
|
110
95
|
|
|
111
|
-
MIT
|
|
96
|
+
MIT. Captured native test widgets retain DeepSeek's MIT license.
|
package/README.md
CHANGED
|
@@ -1,111 +1,107 @@
|
|
|
1
1
|
# dsh-auto-collapse
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> DSH Web 工作段折叠:保留原生一级,把正文之间的思考、工具和上下文合成一个二级;展开后显示原生三级。
|
|
4
4
|
>
|
|
5
|
-
> English
|
|
6
|
-
>
|
|
7
|
-
> 本插件已收录到插件市场(Plugin marketplace):[市场链接](https://www.dsh.so/artifact/dsh-auto-collapse/)
|
|
5
|
+
> [English](README.en.md) · [插件市场](https://www.dsh.so/artifact/dsh-auto-collapse/)
|
|
8
6
|
|
|
9
|
-
##
|
|
7
|
+
## 展示方式
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
```text
|
|
10
|
+
正文 A
|
|
11
|
+
▸ 已思考 · 使用了浏览器 · 已注入上下文 · 编辑了文件
|
|
12
|
+
正文 B
|
|
13
|
+
▸ 正在运行 npm run check
|
|
14
|
+
正文 C
|
|
15
|
+
```
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
每段只有一个二级入口。思考变成工具调用、工具后追加上下文,都继续归入当前段;新正文出现后,后续工作另起一段。只有思考、只有上下文或单条工具也可以成段。
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
- **一级:DSH 原生回合摘要。** 完成判断、计数、过程正文与最终回答由宿主负责。
|
|
20
|
+
- **二级:插件工作段。** 工作中可见,展开原生一级后也保留;默认收起,流式追加保持手动展开意图。
|
|
21
|
+
- **三级:原生工作行。** 二级展开后按原顺序展示思考、工具、上下文;每行自己的详情开合保持原样。
|
|
16
22
|
|
|
17
|
-
|
|
23
|
+

|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
- **二级折叠行**:展开一级后,工具调用组与思考块各自折叠成一行 chip(`正在运行 {命令}` / `运行了命令` / `已思考`),点击展开/收起;相邻工具组合并,正文输出是硬边界(不会跨正文合并)。
|
|
21
|
-
- **三级思考合并**:展开 `已思考` 后,连续思考合并为一个三级思考行(标题 `Think · 第一句`),点击展开合并内容块;原始四级行不出现。
|
|
22
|
-
- **原生视觉对齐**:图标盒 16px / glyph 14px / 行高 24px / 行距 16px,颜色使用 DSH 原生 token(`--dsw-alias-label-*`),思考与命令图标取自 DSH 原生图标(`IconThinkOutline14` / `IconApiOutline14`)。
|
|
23
|
-
- **展开/收起过渡动画**:点击驱动的展开(淡入 + 4px 上移,合并思考正文带高度展开)与收起(镜像淡出,后代随祖先 seat 整体消失、无跳变)均为 180ms;仅用户点击触发动画,流式协调器决策保持瞬时。
|
|
24
|
-
- **流式友好**:同一个 `assistant-step` 原地补正文、React 换节点和历史乱序挂载都会重新协调;running 状态带文字平滑呼吸动画,`prefers-reduced-motion` 下停止动画(过渡动画同样禁用)。
|
|
25
|
-
- **完整工作类型**:除 tool-call 外,顶层 `command` / `manual-compaction`、context 和纯图片 final 都按同一回合语义处理。
|
|
26
|
-
- **可配置状态提示词**:在 设置 → 插件 → 插件配置 中可以编辑“状态提示词”,默认 `Deep sleeping...`;留空保存后恢复官方原文(当前版本为“深度求索中...”)。宿主追加的用时后缀(如 `33秒`)保留。
|
|
27
|
-
- **可逆**:卸载(HMR stop)时完整还原所有折叠/隐藏/改写。
|
|
25
|
+
预览来自浏览器验收场景,使用 DSH 0.1.2-rc.1 原生 disclosure、思考和回合摘要组件。
|
|
28
26
|
|
|
29
|
-
##
|
|
27
|
+
## 行为
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|---|---|
|
|
33
|
-
| 0.1.8 | **DSH 0.1.2-rc.1+**(settings 可重连生命周期、原生回合摘要行、中文状态文案) |
|
|
34
|
-
| 0.1.7 | DSH 0.1.2-rc.1+(初版适配;启动时序下设置卡可能缺席,建议升级 0.1.8) |
|
|
35
|
-
| ≤ 0.1.6 | DSH 0.1.1.x |
|
|
29
|
+
正文是分组边界,同一 `assistant-step` 内的“思考—正文—思考”也会切开;Markdown 换行不拆组。纯图片、SVG 和其他正文内容保持原生展示。用户消息、steering、不同 turn 和未知语义节点不会被跨越。
|
|
36
30
|
|
|
37
|
-
|
|
31
|
+
原生一级收起时,受它控制的二级入口一起隐藏,但二级状态保留。若上下文位于原生折叠范围之外,仍保留可访问的二级入口;点击展开会按需打开原生一级。Normal 模式没有原生一级时,二级仍生效。
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
系统提示词也归入相邻的上下文工作段。有明确回合归属时,它跟随原生一级收起;一级展开后先显示二级,展开二级才显示系统提示词的原生行,详情开关保持原样。
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
工作摘要显示已发生的动作类型和当前运行信息,不复制推理全文。查找隐藏内容时通过 `hidden="until-found"` / `beforematch` 展开所属层级。选中、焦点和需要用户输入的工作保持可达。HMR、切换会话或异常恢复会释放插件控制。
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
dsh plugin --profile web add "dsh-auto-collapse"
|
|
45
|
-
```
|
|
37
|
+
设置 → 插件 → 插件配置仍可编辑“状态提示词”,默认 `Deep sleeping...`。保存空值恢复官方文字;用时后缀保留。该功能独立于分组,服务晚到或重连不会影响二级。
|
|
46
38
|
|
|
47
|
-
|
|
39
|
+
## 兼容性与升级
|
|
48
40
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
## 开发
|
|
41
|
+
| 插件 | 验证的 DSH |
|
|
42
|
+
|---|---|
|
|
43
|
+
| 0.2.x | 0.1.2-rc.1;浏览器验收含该版本原生组件 |
|
|
44
|
+
| 0.1.8 | 0.1.2-rc.1,旧折叠实现 |
|
|
45
|
+
| ≤ 0.1.6 | 0.1.1.x |
|
|
56
46
|
|
|
57
|
-
|
|
47
|
+
0.2.0 完全重写了折叠核心。升级后保留并统一二级,删除自建“已处理 X秒”一级行和三级推理全文副本;上下文不再单独拆成二级。旧 `statusText` 配置继续使用。未知 DOM 节点保留原生展示,其他宿主版本需要另行验证。
|
|
58
48
|
|
|
59
|
-
|
|
60
|
-
src/fold.ts 核心:FoldController(状态机)+ findBlocks(块识别)+ 折叠/展开逻辑
|
|
61
|
-
src/client.ts 浏览器端入口(注册插件)
|
|
62
|
-
src/index.ts host half(宿主端,Host half)
|
|
63
|
-
build.mjs 构建脚本(Build script):生成 lib/client.js、lib/index.js 与 lib/types/*
|
|
64
|
-
tsconfig.build.json TypeScript 声明构建配置(Declaration build config)
|
|
65
|
-
deploy.mjs 安全部署(Safe deploy):校验 → 备份 → 替换 → 身份核验重启 → 哈希验证/回滚(DSH web 输出持久化到 ~/.dsh/logs/web.{out,err}.log);Windows 使用 PowerShell,Linux/macOS 使用 lsof + ps
|
|
66
|
-
cordis.patch.yml profile 树挂载
|
|
67
|
-
test/ fake DOM 契约、竞态、会话切换与 40 组乱序排列回归
|
|
68
|
-
```
|
|
49
|
+
## 安装
|
|
69
50
|
|
|
70
|
-
|
|
51
|
+
已发布版本可用:
|
|
71
52
|
|
|
72
53
|
```bash
|
|
73
|
-
|
|
54
|
+
dsh plugin --profile web add dsh-auto-collapse
|
|
74
55
|
```
|
|
75
56
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
### 快速部署(本机开发)
|
|
57
|
+
从源码安装时,先生成完整安装包,再安装命令输出的 tgz:
|
|
79
58
|
|
|
80
59
|
```bash
|
|
81
|
-
npm
|
|
60
|
+
npm ci
|
|
61
|
+
npm run package
|
|
62
|
+
dsh plugin --profile web add <生成的-tgz-绝对路径>
|
|
82
63
|
```
|
|
83
64
|
|
|
84
|
-
|
|
65
|
+
安装后按宿主方式重载插件或重启 Web,再刷新页面。回退时安装完整旧版包,例如 `dsh-auto-collapse@0.1.8`。
|
|
85
66
|
|
|
86
|
-
|
|
67
|
+
`npm run package` 与兼容别名 `npm run deploy` **只构建 tgz**,不再逐文件覆盖安装目录、读取凭据或自动停止/启动 DSH。
|
|
87
68
|
|
|
88
|
-
|
|
69
|
+
## 开发与验证
|
|
70
|
+
|
|
71
|
+
Node.js 22+。首次浏览器验证需要 Playwright Chromium;Windows 可自动使用已安装的 Chrome/Edge,也可通过 `DSH_TEST_BROWSER` 指定可执行文件。
|
|
89
72
|
|
|
90
73
|
```bash
|
|
91
|
-
npm
|
|
74
|
+
npm ci
|
|
75
|
+
npx playwright install chromium
|
|
76
|
+
npm run check
|
|
92
77
|
```
|
|
93
78
|
|
|
94
|
-
|
|
79
|
+
Linux CI 使用 `npx playwright install --with-deps chromium` 安装浏览器依赖。
|
|
95
80
|
|
|
96
81
|
```bash
|
|
97
|
-
npm
|
|
82
|
+
npm run test:unit # 纯分组、身份、状态摘要
|
|
83
|
+
npm run test:browser # 当前构建的真实浏览器验收
|
|
84
|
+
npm run preview # 本地合成场景:http://127.0.0.1:43190
|
|
85
|
+
npm run package # artifacts/ 下完整 tgz
|
|
98
86
|
```
|
|
99
87
|
|
|
100
|
-
|
|
88
|
+
修改源码后先 `npm run build` 再单独运行浏览器测试或刷新预览。`npm run check` 自动执行 typecheck、构建、单元测试、浏览器测试和安装包检查。
|
|
89
|
+
|
|
90
|
+
浏览器测试使用真实 React、原生组件快照和当前发布 bundle,覆盖混合分组、同消息正文边界、原生一级、详情状态、搜索、焦点、SVG、异常恢复、设置生命周期及 100/1,000/5,000 个历史节点。完整测试还包含 30 秒无轮询检查。fixture 不依赖用户会话或凭据;完整后端部署不在隔离 fixture 的验证范围内。
|
|
101
91
|
|
|
102
|
-
|
|
92
|
+
## 代码结构
|
|
93
|
+
|
|
94
|
+
| 文件 | 职责 |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `src/work-model.ts` / `host-contract.ts` | 识别正文边界和原生工作项,缓存宿主结构 |
|
|
97
|
+
| `src/work-groups.ts` / `summary.ts` | 纯分组规则、稳定身份、二级展开意图和动作摘要 |
|
|
98
|
+
| `src/dom-view.ts` / `styles.css` | 唯一二级入口、受限显隐、恢复和样式 |
|
|
99
|
+
| `src/controller.ts` / `scheduler.ts` | 脏工作段协调、原生一级联动、生命周期 |
|
|
100
|
+
| `src/status-text.ts` / `settings.ts` | 独立状态文案及设置卡 |
|
|
101
|
+
| `src/client.ts` / `index.ts` | 客户端与宿主接线 |
|
|
103
102
|
|
|
104
|
-
|
|
105
|
-
- **segment 协调**:每轮根据当前 DOM 顺序重建 segment;最后一个含文本或媒体的 `assistant-step` 是 final,其余正文是中间过程。稳定 flow/key 复用展开状态,不依赖一次性 mutation 事件。
|
|
106
|
-
- **时长**:流式回合按 segment 分别记录 running 起点;历史回合从官方时长或 `timeStart`/turn-tail 解析。格式 `X秒` / `X分Y秒`,整分省略秒位。
|
|
107
|
-
- **React 共存与可逆性**:节点替换后按稳定 key 重新绑定;一级行被移除会按原展开状态重建;所有 inline `display` 在首次改写前保存并精确恢复。
|
|
103
|
+
不修改消息内容,不移动原生节点,不接管原生 renderer,不推断 final,不扫描“空 div”,不回写主滚动容器。
|
|
108
104
|
|
|
109
105
|
## 许可
|
|
110
106
|
|
|
111
|
-
MIT
|
|
107
|
+
MIT。测试中的原生组件快照保留 DeepSeek 的 MIT 许可。
|
|
Binary file
|