@khorsheed/dsh-message-timeline 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/CHANGELOG.md +11 -0
- package/README.en.md +79 -0
- package/README.i18n.yaml +6 -0
- package/README.md +79 -0
- package/cordis.patch.yml +6 -0
- package/lib/client.js +521 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +11 -0
- package/lib/invariant.js +28 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/client/TimelineRail.d.ts +10 -0
- package/lib/types/client/TimelineRail.d.ts.map +1 -0
- package/lib/types/client/TimelineRail.js +152 -0
- package/lib/types/client/config.d.ts +39 -0
- package/lib/types/client/config.d.ts.map +1 -0
- package/lib/types/client/config.js +30 -0
- package/lib/types/client/index.d.ts +29 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/index.js +49 -0
- package/lib/types/client/locales.d.ts +20 -0
- package/lib/types/client/locales.d.ts.map +1 -0
- package/lib/types/client/locales.js +11 -0
- package/lib/types/client/preview.d.ts +13 -0
- package/lib/types/client/preview.d.ts.map +1 -0
- package/lib/types/client/preview.js +13 -0
- package/lib/types/client/rail-tracker.d.ts +84 -0
- package/lib/types/client/rail-tracker.d.ts.map +1 -0
- package/lib/types/client/rail-tracker.js +240 -0
- package/lib/types/client/slots.d.ts +62 -0
- package/lib/types/client/slots.d.ts.map +1 -0
- package/lib/types/client/slots.js +1 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +8 -0
- package/lib/types/invariant.d.ts +16 -0
- package/lib/types/invariant.d.ts.map +1 -0
- package/lib/types/invariant.js +26 -0
- package/package.json +79 -0
package/CHANGELOG.md
ADDED
package/README.en.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# dsh-message-timeline
|
|
2
|
+
|
|
3
|
+
English | [中文](README.md)
|
|
4
|
+
|
|
5
|
+
A jump-to-message timeline for the dsh web GUI: a floating rail on the chat's left edge with one row per user message. Hover to reveal previews, click to scroll the transcript straight to that message.
|
|
6
|
+
|
|
7
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-web-basic/main/docs/screenshots/message-timeline1.png" width="480" alt="floating message timeline along the chat's left edge">
|
|
8
|
+
|
|
9
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-web-basic/main/docs/screenshots/message-timeline2.png" width="480" alt="the timeline rests as a thin rail out of sight, expanding on hover">
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **One row per user message** — tick plus ellipsized one-line preview; steering messages count too (configurable off).
|
|
14
|
+
- **Ambient rest state** — only dimmed ticks show until you hover the strip or focus the list.
|
|
15
|
+
- **Reading position tracking** — the current position's tick stays lit blue, anchoring to the user message a long answer is replying to.
|
|
16
|
+
- **Click to jump** — a row scrolls the transcript to that message; the list follows the reading position.
|
|
17
|
+
- **Long-history friendly** — a short list centers vertically; a long one scrolls and pages older history at its top.
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add @khorsheed/dsh-message-timeline
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then restart the web instance. Uninstall:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
dsh plugin --profile web remove @khorsheed/dsh-message-timeline
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Config
|
|
32
|
+
|
|
33
|
+
| Field | Default | Meaning |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `enabled` | `true` | Master switch; false hides the panel entirely. |
|
|
36
|
+
| `includeSteering` | `true` | Count steering messages (user text admitted mid-turn) as rows. |
|
|
37
|
+
| `panelWidth` | `360` | Panel width in px (clamped 120–640); shrinks to fit a narrow column, hides entirely when the gutter is too small. |
|
|
38
|
+
| `initialPages` | `5` | History pages (50 events each) prefetched on open; older pages load when the panel is scrolled to its top (clamped 1–20). |
|
|
39
|
+
|
|
40
|
+
## Compatibility
|
|
41
|
+
|
|
42
|
+
- npm release line (`@deepseek-ai/dsh@0.1.1-rc.2`): ✅ full — the rc.8→0.1.1-rc.1 API audit (2026-08-21) confirms every surface this plugin consumes is unchanged or additive (the ProjectionDefinition restructure, cacheHitPercent return-type change, and the credentials/updated event rename do not touch this package); no source change was needed; re-audited for rc.2 (2026-08-22): consumed surface unchanged, full build+test green.
|
|
43
|
+
- source line (deepseek-harness master): ✅
|
|
44
|
+
|
|
45
|
+
## Known Limitations
|
|
46
|
+
|
|
47
|
+
- **DOM probe coupling** — the panel targets official row attributes and the `[data-conversation-scroll]` scrollport; if the official DOM changes, it hides itself (one `console.warn`) until the probe is updated.
|
|
48
|
+
- **Single rendered session** — rows and jumps address only the currently rendered conversation.
|
|
49
|
+
- **Loaded history only** — rows cover materialized nodes; older messages arrive one page at a time when the panel is scrolled to its top.
|
|
50
|
+
- **No full index view yet** — a searchable message-index tab is planned.
|
|
51
|
+
|
|
52
|
+
## How it works
|
|
53
|
+
|
|
54
|
+
<details>
|
|
55
|
+
<summary>Internals (click to expand)</summary>
|
|
56
|
+
|
|
57
|
+
The plugin is purely additive and modifies no official code.
|
|
58
|
+
|
|
59
|
+
- `src/client/index.ts` — plugin body (`apply`/`inject`)
|
|
60
|
+
- `src/client/rail-tracker.ts` — the only DOM the plugin touches: read-only probes plus the jump's scroll write
|
|
61
|
+
- `src/client/TimelineRail.tsx` — the panel component
|
|
62
|
+
- `src/client/preview.ts` — message content to one-line preview text
|
|
63
|
+
- `src/index.ts` — empty host `apply`, anchors the plugin into the host Loader
|
|
64
|
+
|
|
65
|
+
**Mount & data** — one entry in the official `conversation.session.header.utilities` slot anchors the plugin into the session scope; the panel renders through a body portal with fixed geometry measured from the official scrollport. Rows derive from the framework `useSession` chat snapshot (`s.chat.order` / `s.chat.nodes`), filtered to `user` / `steering` nodes — no store outside the session, no event registration.
|
|
66
|
+
|
|
67
|
+
**Jump & degradation** — clicking a row finds the transcript row by the official `data-chat-anchor-key` attribute and writes `scrollTop`; the official ChatView treats that as a normal reader move (bottom-follow and scroll memory keep working). The probed attributes are official render output, not a declared API: when they change, the panel hides itself with one `console.warn`; nothing throws and the boot never fails.
|
|
68
|
+
|
|
69
|
+
**Model experience: none.** The panel reads the session snapshot and scrolls the transcript; it never sends prompts, appends session events, or enters the session log. KV cache effect: none. The `enabled` config turns the plugin off entirely; removing it from cordis.yml removes every surface it adds.
|
|
70
|
+
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
## Development
|
|
74
|
+
|
|
75
|
+
Part of the [dsh-plugins](https://github.com/Khorsheed/dsh-plugins) monorepo (`packages/message-timeline`). Issues and contributions welcome there.
|
|
76
|
+
|
|
77
|
+
## Changelog
|
|
78
|
+
|
|
79
|
+
See [CHANGELOG.md](CHANGELOG.md).
|
package/README.i18n.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record: the git blob hash of each side as of the
|
|
2
|
+
# last confirmed-consistent state. Both languages carry equal authority; after
|
|
3
|
+
# editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/message-timeline/README.en.md
|
|
5
|
+
packages/message-timeline/README.en.md: 6c23db63db34214d844f5db121fb8e87b9565a05
|
|
6
|
+
packages/message-timeline/README.md: da68ead740c42b8ceb770047aefdb8f61ce733d2
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# dsh-message-timeline
|
|
2
|
+
|
|
3
|
+
[English](README.en.md) | 中文
|
|
4
|
+
|
|
5
|
+
dsh web GUI 的历史消息导览:会话左缘的一条悬浮时间轴,每行一条用户消息。悬停显示预览,点击直接把会话滚动到对应消息。
|
|
6
|
+
|
|
7
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-web-basic/main/docs/screenshots/message-timeline1.png" width="480" alt="会话左缘的悬浮消息时间轴">
|
|
8
|
+
|
|
9
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-web-basic/main/docs/screenshots/message-timeline2.png" width="480" alt="时间轴日常收成一条细线不占视线,悬停才展开">
|
|
10
|
+
|
|
11
|
+
## 特性
|
|
12
|
+
|
|
13
|
+
- **每行一条用户消息**——竖刻度加单行省略预览;steering 消息也计入(可配置关闭)。
|
|
14
|
+
- **环境化静止态**——只显示压淡的刻度,悬停刻度条或聚焦列表才展开文字。
|
|
15
|
+
- **阅读位置跟踪**——当前位置的刻度保持蓝色高亮,停在超长回复中时锚定在所回答的用户消息上。
|
|
16
|
+
- **点击跳转**——点击行把会话滚动到对应消息;列表跟随阅读位置。
|
|
17
|
+
- **长历史友好**——列表短时垂直居中,长时隐形滚动并在顶部翻页加载更早历史。
|
|
18
|
+
|
|
19
|
+
## 安装
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add @khorsheed/dsh-message-timeline
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
然后重启 web 实例。卸载:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
dsh plugin --profile web remove @khorsheed/dsh-message-timeline
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 配置
|
|
32
|
+
|
|
33
|
+
| 字段 | 默认 | 含义 |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `enabled` | `true` | 总开关;false 时面板完全不渲染。 |
|
|
36
|
+
| `includeSteering` | `true` | 回合中插入的用户消息(steering)是否也算行。 |
|
|
37
|
+
| `panelWidth` | `360` | 面板宽度(px,限 120–640);窄列自动收缩,左缘沟槽放不下时整条隐藏。 |
|
|
38
|
+
| `initialPages` | `5` | 面板打开时预取的历史页数(每页 50 条事件);更早历史在面板滚动到顶部时按需加载(限 1–20)。 |
|
|
39
|
+
|
|
40
|
+
## Compatibility
|
|
41
|
+
|
|
42
|
+
- npm 发布线(`@deepseek-ai/dsh@0.1.1-rc.2`):✅ 完整——rc.8→0.1.1-rc.1 API 审计(2026-08-21)确认本插件消费的所有面无变化或纯增量(ProjectionDefinition 重构、cacheHitPercent 返回值变更、credentials/updated 事件改名均不涉及本包),无需改动源码;rc.1→rc.2 复核(2026-08-22):消费面无变化,全量构建测试通过。
|
|
43
|
+
- 源码线(deepseek-harness master):✅
|
|
44
|
+
|
|
45
|
+
## 已知限制
|
|
46
|
+
|
|
47
|
+
- **依赖官方 DOM 探针** —— 面板针对官方行属性与 `[data-conversation-scroll]` 滚动区;官方结构变化时面板自行隐藏(console.warn 一次)直到探针更新。
|
|
48
|
+
- **单会话渲染** —— 行与跳转只作用于当前渲染的会话。
|
|
49
|
+
- **仅已加载历史** —— 行覆盖已物化的节点;更早消息在面板滚动到顶部时逐页加载。
|
|
50
|
+
- **暂无整页导览** —— 可搜索的消息索引标签页在计划中。
|
|
51
|
+
|
|
52
|
+
## 实现原理
|
|
53
|
+
|
|
54
|
+
<details>
|
|
55
|
+
<summary>内部结构(点击展开)</summary>
|
|
56
|
+
|
|
57
|
+
插件纯增量、不改任何官方代码。
|
|
58
|
+
|
|
59
|
+
- `src/client/index.ts` —— 插件主体(`apply`/`inject`)
|
|
60
|
+
- `src/client/rail-tracker.ts` —— 插件唯一接触的 DOM:只读探针加跳转时的滚动写入
|
|
61
|
+
- `src/client/TimelineRail.tsx` —— 面板组件
|
|
62
|
+
- `src/client/preview.ts` —— 消息内容转单行预览文本
|
|
63
|
+
- `src/index.ts` —— 空的宿主 `apply`,只负责把插件锚定进宿主 Loader
|
|
64
|
+
|
|
65
|
+
**挂载与数据** —— 一个条目注册进官方 `conversation.session.header.utilities` 槽位,把插件锚定进会话作用域;面板通过 body portal 以固定几何渲染,数据从官方滚动区实测。行取自框架 `useSession` 会话快照(`s.chat.order` / `s.chat.nodes`),过滤 `user` / `steering` 节点——不持有会话外状态,不注册事件。
|
|
66
|
+
|
|
67
|
+
**跳转与降级** —— 点击行按官方 `data-chat-anchor-key` 属性找到会话行并写 `scrollTop`;官方 ChatView 把这种程序化滚动当正常读者移动处理(底部跟随与滚动记忆照常工作)。探测的属性是官方渲染产物而非契约 API:官方改结构时面板自行隐藏并 console.warn 一次,不抛错、boot 永不失败。
|
|
68
|
+
|
|
69
|
+
**模型体验:无。** 面板只读会话快照并滚动会话,不发送提示词、不追加会话事件、不进会话日志。KV 缓存影响:无。`enabled` 配置可整体关闭插件;从 cordis.yml 移除本插件即移除它添加的所有界面。
|
|
70
|
+
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
## 开发
|
|
74
|
+
|
|
75
|
+
隶属 [dsh-plugins](https://github.com/Khorsheed/dsh-plugins) monorepo(`packages/message-timeline`)。问题与贡献请移步该仓库。
|
|
76
|
+
|
|
77
|
+
## 变更记录
|
|
78
|
+
|
|
79
|
+
见 [CHANGELOG.md](CHANGELOG.md)。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# message-timeline bundle patch: inserts the plugin row into the composing profile.
|
|
2
|
+
# The browser half is discovered through the package.json dsh.client block; the
|
|
3
|
+
# node half is the empty apply that makes the row a real loader entry.
|
|
4
|
+
- insert:
|
|
5
|
+
- id: message-timeline
|
|
6
|
+
name: '@khorsheed/dsh-message-timeline'
|