dsh-pulse-overview 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +101 -2
- package/README_EN.md +109 -0
- package/assets/icon-180.png +0 -0
- package/assets/icon.svg +14 -0
- package/client/index.mjs +1675 -0
- package/cordis.patch.yml +3 -0
- package/index.mjs +427 -0
- package/lib/activity.mjs +234 -0
- package/lib/books.mjs +215 -0
- package/lib/config.mjs +93 -0
- package/lib/overview.mjs +311 -0
- package/lib/sessions.mjs +150 -0
- package/lib/token-index.mjs +669 -0
- package/lib/zstd-frames.mjs +98 -0
- package/locale/de.json +6 -0
- package/locale/en.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +70 -4
- package/scripts/check-npm-token.mjs +69 -0
- package/scripts/lib/skip-report.mjs +46 -0
- package/scripts/render-preview.py +355 -0
- package/scripts/verify-activity.mjs +439 -0
- package/scripts/verify-books.mjs +245 -0
- package/scripts/verify-client.mjs +569 -0
- package/scripts/verify-config.mjs +216 -0
- package/scripts/verify-host.mjs +372 -0
- package/scripts/verify-overview.mjs +395 -0
- package/scripts/verify-placement.mjs +436 -0
- package/scripts/verify-render.mjs +726 -0
- package/scripts/verify-token-index.mjs +559 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LiuYanFeng
|
|
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
CHANGED
|
@@ -1,3 +1,102 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-pulse-overview
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
给 [DeepSeek Harness](https://github.com/deepseek-ai) 的**新会话页面**加两块统计:
|
|
4
|
+
|
|
5
|
+
1. **活动概览** —— 一张 2 × 4 的指标卡,八项数据一眼看完;
|
|
6
|
+
2. **活跃度热力图** —— 最近一年每天有多活跃,像 GitHub 的贡献格子。
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
┌ 活动概览 [全部] [365 天] [30 天] [7 天] ┐
|
|
12
|
+
│ 全部 140 次会话 │
|
|
13
|
+
│ ┌会话数┐ ┌消息数┐ ┌总 Token┐ ┌活跃天数┐ │
|
|
14
|
+
│ │ 140 │ │48,668│ │ 149.4亿 │ │ 58 天 │ │
|
|
15
|
+
│ └──────┘ └──────┘ └────────┘ └────────┘ │
|
|
16
|
+
│ ┌当前连续┐ ┌最长连续┐ ┌活跃时段┐ ┌常用模型┐ │
|
|
17
|
+
│ │ 7 天 │ │ 8 天 │ │ 17:00 │ │ v4.1-… │ │
|
|
18
|
+
│ └────────┘ └────────┘ └────────┘ └────────┘ │
|
|
19
|
+
│ 00:00 ▁▁▂▂▅▃▁▁▂▃▃▃▆▂▂▂▁▂▃▃▁▁▂▁ 23:00 │
|
|
20
|
+
│ ≈ 8.9 部《二十四史》 │
|
|
21
|
+
└───────────────────────────────────────────────────────┘
|
|
22
|
+
┌ 活跃度 [会话] [Token] 139 个会话 少 ▢ ▢ ▣ ▣ ▣ 多 ┐
|
|
23
|
+
│ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▣ ▣ ▢ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ … │
|
|
24
|
+
│ 1月 2月 3月 4月 5月 6月 7月 … │
|
|
25
|
+
└──────────────────────────────────────────────────────────────────────────┘
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 活动概览
|
|
29
|
+
|
|
30
|
+
八项指标,一张 2 × 4 的栅格:
|
|
31
|
+
|
|
32
|
+
| 指标 | 说明 |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| 会话数 | 一共开过多少个会话 |
|
|
35
|
+
| 消息数 | 实际结算过的消息条数 |
|
|
36
|
+
| 总 Token | 累计消耗的 token |
|
|
37
|
+
| 活跃天数 | 有记录的天数 |
|
|
38
|
+
| 当前连续 | 到今天为止连续活跃了几天 |
|
|
39
|
+
| 最长连续 | 历史最长连续活跃记录 |
|
|
40
|
+
| 活跃时段 | 你最常在一天里的哪个小时干活 |
|
|
41
|
+
| 常用模型 | 用得最多的那个模型 |
|
|
42
|
+
|
|
43
|
+
上方可以切换 **全部 / 365 天 / 30 天 / 7 天** 四个时间范围,默认「全部」。
|
|
44
|
+
「总 Token」「最长连续」「活跃天数」本来就是全时段的概念,所以默认不设窗口;
|
|
45
|
+
需要看近期状态时切到 30 天或 7 天。
|
|
46
|
+
|
|
47
|
+
底部有一条 **24 小时消息分布**,最高那根柱子实心显示,一眼看出你的作息。
|
|
48
|
+
|
|
49
|
+
## 活跃度热力图
|
|
50
|
+
|
|
51
|
+
最近一年每天一个格子,颜色越深当天越活跃。
|
|
52
|
+
|
|
53
|
+
顶部可切换 **会话数 / Token 用量** 两种口径,共用同一张网格与日期轴,切换时格子位置不动。
|
|
54
|
+
鼠标悬停显示具体日期与数值。
|
|
55
|
+
|
|
56
|
+
## 「≈ N 部书」
|
|
57
|
+
|
|
58
|
+
Token 总量换算成「相当于读了多少部书」—— token 数字没有直觉,书有。
|
|
59
|
+
|
|
60
|
+
换算基于**新内容**(你实际读入的与模型生成的部分),不把重复读取的上下文算进去:
|
|
61
|
+
重度使用时重复读取能占到九成以上,拿它比作「读了多少书」会严重虚高。
|
|
62
|
+
悬停可以看到两种口径的完整数字。
|
|
63
|
+
|
|
64
|
+
书目 58 部,覆盖计算机、科学、科幻、历史、小说、传记与大型参考书,
|
|
65
|
+
按用量自动挑最贴切的那一部。
|
|
66
|
+
|
|
67
|
+
## 显示在哪
|
|
68
|
+
|
|
69
|
+
**新会话页面**大标题的正下方,与输入框同宽的两张卡片,上下排列:活动概览在上,热力图在下。
|
|
70
|
+
窗口缩放时跟着变宽变窄。
|
|
71
|
+
|
|
72
|
+
开始第一轮对话后,这个区域会随宿主一起消失 —— 这是宿主本来的行为。
|
|
73
|
+
|
|
74
|
+
## 安装
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
dsh plugin --profile web add dsh-pulse-overview
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
装完刷新页面,新开一个会话即可看到。
|
|
81
|
+
|
|
82
|
+
## 设置
|
|
83
|
+
|
|
84
|
+
**设置 → 活跃度**:
|
|
85
|
+
|
|
86
|
+
- **显示活动概览** —— 开关,默认开
|
|
87
|
+
- **显示会话热力图** —— 开关,默认开
|
|
88
|
+
- **默认指标** —— 热力图默认按会话数还是 Token 显示
|
|
89
|
+
|
|
90
|
+
两个开关相互独立,可以只留其中一张卡。关掉之后不做任何统计,也不占位置。
|
|
91
|
+
重新打开即时生效,不需要重启。
|
|
92
|
+
|
|
93
|
+
## 隐私
|
|
94
|
+
|
|
95
|
+
全部在本地完成。
|
|
96
|
+
|
|
97
|
+
插件读取本地会话文件的时间戳;在需要 Token 与模型数据时,**在本地**解压会话日志,
|
|
98
|
+
只取出用量计数与模型名。不上传任何内容,不解析、不保存对话正文。
|
|
99
|
+
|
|
100
|
+
## 许可证
|
|
101
|
+
|
|
102
|
+
MIT
|
package/README_EN.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# dsh-pulse-overview
|
|
2
|
+
|
|
3
|
+
Two statistics panels for [DeepSeek Harness](https://github.com/deepseek-ai)'s **New Session** screen:
|
|
4
|
+
|
|
5
|
+
1. **Activity overview** — a 2 × 4 metric grid, eight numbers at a glance;
|
|
6
|
+
2. **Activity heat map** — how active each day of the past year was, like GitHub's contribution graph.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
┌ Overview [All] [365 days] [30 days] [7 days] ┐
|
|
12
|
+
│ All 140 sessions │
|
|
13
|
+
│ ┌Sessions┐ ┌Messages┐ ┌Tokens┐ ┌Active days┐ │
|
|
14
|
+
│ │ 140 │ │ 48,668 │ │ 1.49B │ │ 58 d │ │
|
|
15
|
+
│ └────────┘ └────────┘ └───────┘ └───────────┘ │
|
|
16
|
+
│ ┌Streak┐ ┌Longest┐ ┌Peak hour┐ ┌Top model┐ │
|
|
17
|
+
│ │ 7 d │ │ 8 d │ │ 17:00 │ │ v4.1-… │ │
|
|
18
|
+
│ └──────┘ └────────┘ └──────────┘ └─────────┘ │
|
|
19
|
+
│ 00:00 ▁▁▂▂▅▃▁▁▂▃▃▃▆▂▂▂▁▂▃▃▁▁▂▁ 23:00 │
|
|
20
|
+
│ ≈ 8.9 × 《二十四史》 │
|
|
21
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
22
|
+
┌ Activity [Sessions] [Tokens] 139 sessions Less ▢ ▢ ▣ ▣ ▣ More ┐
|
|
23
|
+
│ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▢ ▣ ▣ ▢ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ … │
|
|
24
|
+
│ Jan Feb Mar Apr May Jun Jul … │
|
|
25
|
+
└──────────────────────────────────────────────────────────────────────────────────┘
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Activity overview
|
|
29
|
+
|
|
30
|
+
Eight metrics in a 2 × 4 grid:
|
|
31
|
+
|
|
32
|
+
| Metric | Meaning |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Sessions | How many conversations you have started |
|
|
35
|
+
| Messages | How many messages actually settled |
|
|
36
|
+
| Tokens | Cumulative token spend |
|
|
37
|
+
| Active days | Days with any activity |
|
|
38
|
+
| Current streak | Consecutive active days up to today |
|
|
39
|
+
| Longest streak | Your all-time longest run |
|
|
40
|
+
| Peak hours | The hour of day you work most |
|
|
41
|
+
| Top model | The model you reach for most |
|
|
42
|
+
|
|
43
|
+
Switch the range with **All / 365 / 30 / 7 days**; the default is **All**.
|
|
44
|
+
Total tokens, longest streak and active days are whole-history concepts, so no
|
|
45
|
+
window is applied by default — drop to 30 or 7 days when you want the recent picture.
|
|
46
|
+
|
|
47
|
+
A **24-hour message histogram** sits at the bottom, peak bar filled solid, so your
|
|
48
|
+
daily rhythm is visible at a glance.
|
|
49
|
+
|
|
50
|
+
## Activity heat map
|
|
51
|
+
|
|
52
|
+
One cell per day for the past year; darker means more active that day.
|
|
53
|
+
|
|
54
|
+
Toggle between **session counts** and **token usage** at the top — both share the same
|
|
55
|
+
grid and date axis, so cells never move when you switch. Hover shows the exact date
|
|
56
|
+
and value.
|
|
57
|
+
|
|
58
|
+
## "≈ N books"
|
|
59
|
+
|
|
60
|
+
Total tokens expressed as how many books that would fill — raw token counts have no
|
|
61
|
+
intuition, books do.
|
|
62
|
+
|
|
63
|
+
The conversion uses **new content** (what you actually read in and what the model
|
|
64
|
+
generated), excluding repeated context reads: under heavy use, re-reads can account
|
|
65
|
+
for more than ninety percent, and counting them would badly inflate "books read".
|
|
66
|
+
Hover to see both figures.
|
|
67
|
+
|
|
68
|
+
The shelf holds 58 works across computer science, science, sci-fi, history, fiction,
|
|
69
|
+
biography and large reference collections; the closest-fitting one is picked
|
|
70
|
+
automatically from your volume.
|
|
71
|
+
|
|
72
|
+
## Where it appears
|
|
73
|
+
|
|
74
|
+
Directly beneath the big heading on the **New Session** screen: two cards stacked
|
|
75
|
+
vertically, as wide as the composer below them, resizing with the window.
|
|
76
|
+
|
|
77
|
+
Once the first exchange begins, this area disappears along with the host's own
|
|
78
|
+
hero region — that is the host's behaviour, not something this plugin adds.
|
|
79
|
+
|
|
80
|
+
## Install
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
dsh plugin --profile web add dsh-pulse-overview
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Refresh the page and open a new session.
|
|
87
|
+
|
|
88
|
+
## Settings
|
|
89
|
+
|
|
90
|
+
**Settings → Activity**:
|
|
91
|
+
|
|
92
|
+
- **Show the activity overview** — on by default
|
|
93
|
+
- **Show the session heat map** — on by default
|
|
94
|
+
- **Default metric** — whether the heat map opens on sessions or tokens
|
|
95
|
+
|
|
96
|
+
The two switches are independent; either card can be turned off alone. Turning one
|
|
97
|
+
off does no computation and frees the space. Changes apply immediately, no restart.
|
|
98
|
+
|
|
99
|
+
## Privacy
|
|
100
|
+
|
|
101
|
+
Everything stays local.
|
|
102
|
+
|
|
103
|
+
The plugin reads timestamps from your local session files; when token and model data
|
|
104
|
+
are needed it **decompresses those logs locally** and takes only usage counts and
|
|
105
|
+
model names. Nothing is uploaded, and no conversation text is parsed or stored.
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
MIT
|
|
Binary file
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" fill="none">
|
|
2
|
+
<rect width="64" height="64" rx="14" fill="#4D6BFE" fill-opacity="0.12"/>
|
|
3
|
+
<g fill="#4D6BFE">
|
|
4
|
+
<rect x="12" y="14" width="10" height="10" rx="2" fill-opacity="0.18"/>
|
|
5
|
+
<rect x="27" y="14" width="10" height="10" rx="2" fill-opacity="0.42"/>
|
|
6
|
+
<rect x="42" y="14" width="10" height="10" rx="2" fill-opacity="0.7"/>
|
|
7
|
+
<rect x="12" y="27" width="10" height="10" rx="2" fill-opacity="0.42"/>
|
|
8
|
+
<rect x="27" y="27" width="10" height="10" rx="2" fill-opacity="1"/>
|
|
9
|
+
<rect x="42" y="27" width="10" height="10" rx="2" fill-opacity="0.55"/>
|
|
10
|
+
<rect x="12" y="40" width="10" height="10" rx="2" fill-opacity="0.7"/>
|
|
11
|
+
<rect x="27" y="40" width="10" height="10" rx="2" fill-opacity="0.18"/>
|
|
12
|
+
<rect x="42" y="40" width="10" height="10" rx="2" fill-opacity="0.42"/>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|