dsh-visualization 0.1.0 → 0.1.2
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/FAQ.md +85 -0
- package/README.md +2 -0
- package/package.json +4 -3
- package/web/index.html +51 -5
package/FAQ.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# FAQ / 常见问题
|
|
2
|
+
|
|
3
|
+
## Why is the license not OSI-approved? / 为什么不用 OSI 许可?
|
|
4
|
+
|
|
5
|
+
**EN** — By design, not by accident. The visual language — the rings, the palette, the layered
|
|
6
|
+
layout — derives from [HALOFLUX](https://github.com/Ryder191/haloflux), which is licensed under
|
|
7
|
+
PolyForm Noncommercial 1.0.0. Those terms require any derivative to stay noncommercial and to keep
|
|
8
|
+
the attribution. An MIT/Apache/BSD badge here would be a promise this project cannot keep, so the
|
|
9
|
+
plugin adopts the same license: free for personal use, study, research, teaching and hobby
|
|
10
|
+
projects; commercial use is not granted.
|
|
11
|
+
|
|
12
|
+
The *code* (host folding, zstd frame parsing, SSE, the page) is original, written for this plugin.
|
|
13
|
+
Nothing was copied from HALOFLUX's source; what it borrows is the design language, and that is
|
|
14
|
+
credited in both the LICENSE and the page footer.
|
|
15
|
+
|
|
16
|
+
**中文** — 这是刻意的,不是疏漏。视觉语言(环、配色、分层布局)来自
|
|
17
|
+
[HALOFLUX](https://github.com/Ryder191/haloflux),它使用 PolyForm Noncommercial 1.0.0。
|
|
18
|
+
该许可要求衍生作品同为非商业并保留署名。这里挂 MIT/Apache 就等于是本项目兑现不了的承诺,
|
|
19
|
+
所以插件沿用同一许可:个人使用、学习、研究、教学、兴趣项目免费;不授予商业用途。
|
|
20
|
+
|
|
21
|
+
代码本身(宿主折叠、zstd 帧解析、SSE、页面)是为本插件新写的,没有复制 HALOFLUX 的源码;
|
|
22
|
+
借用的是设计语言,LICENSE 与页面右下角都写明了出处。
|
|
23
|
+
|
|
24
|
+
> Marketplace listings do not require an OSI-approved license — other listed plugins in this catalog
|
|
25
|
+
> also ship non-OSI terms.
|
|
26
|
+
> 插件市场并不要求 OSI 许可——本目录里已有其他非 OSI 许可的插件。
|
|
27
|
+
|
|
28
|
+
## Does it send my data anywhere? / 会把数据发出去吗?
|
|
29
|
+
|
|
30
|
+
**EN** — No. The host half reads `~/.dsh/sessions/**` read-only, folds it in memory, and serves it on
|
|
31
|
+
`/dsh-visualization/*` to the local page. No outbound network request is made by either half, and no
|
|
32
|
+
file is written except the OS-level cache the browser keeps for the page itself.
|
|
33
|
+
|
|
34
|
+
**中文** — 不会。宿主侧只读 `~/.dsh/sessions/**`,在内存里折叠,通过 `/dsh-visualization/*`
|
|
35
|
+
提供给本地页面。前后两端都不发起任何对外网络请求,也不写任何文件(浏览器自身的页面缓存除外)。
|
|
36
|
+
|
|
37
|
+
## Why can it only be reached from localhost? / 为什么只能本机访问?
|
|
38
|
+
|
|
39
|
+
**EN** — Session logs contain every command you ran and every prompt you typed. The routes answer
|
|
40
|
+
loopback addresses only, so exposing the Web UI on a LAN does not expose the instrument. If you
|
|
41
|
+
really need remote access, set `allowRemote: true` in the plugin config and understand that anyone
|
|
42
|
+
who can reach the port can read those logs.
|
|
43
|
+
|
|
44
|
+
**中文** — 会话日志里有你执行过的每条命令和输入的每句话。路由只响应回环地址,所以把 Web 界面暴露到
|
|
45
|
+
局域网并不会顺带暴露仪表盘。确实需要远程访问时,在插件配置里写 `allowRemote: true`——
|
|
46
|
+
但要清楚:任何能访问该端口的人都能读到这些日志。
|
|
47
|
+
|
|
48
|
+
## The panel is blank / says "no session log" / 面板空白、提示没有会话
|
|
49
|
+
|
|
50
|
+
| 提示 | 原因 |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `这个运行环境不支持 zstd 解压(需要 Node ≥ 22.15)` | 宿主 Node 太老 |
|
|
53
|
+
| `会话目录是空的 —— 先在这个 profile 里跑一轮对话` | 这个 profile 还没聊过 |
|
|
54
|
+
| `还没找到 DSH 会话目录(…),确认 DSH_HOME 是否正确` | DSH 数据不在默认位置;设 `DSH_HOME` 或 `DSHVIZ_SESSIONS_ROOT` |
|
|
55
|
+
| 面板空白 + 网络面板 403 | 不是本机访问;见上一节 |
|
|
56
|
+
|
|
57
|
+
## Does it slow the session down? / 会拖慢会话吗?
|
|
58
|
+
|
|
59
|
+
**EN** — The fold is incremental: only newly appended zstd frames are decoded, and only new events
|
|
60
|
+
are pushed into the accumulator. At ~8.7k events the first fold costs 240–260 ms; afterwards each
|
|
61
|
+
change costs 7–12 ms. When nothing changes, the SSE connection sends zero bytes (except a 15 s
|
|
62
|
+
heartbeat).
|
|
63
|
+
|
|
64
|
+
**中文** — 折叠是增量的:只解新追加的 zstd 帧,只把新事件 push 进累加器。约 8.7k 事件时首次
|
|
65
|
+
240~260ms,之后每次变化 7~12ms。没有变化时 SSE 一个字节都不发(只有 15 秒一次的心跳)。
|
|
66
|
+
|
|
67
|
+
## How do I uninstall it? / 怎么卸载?
|
|
68
|
+
|
|
69
|
+
```powershell
|
|
70
|
+
# DSH 插件页里关掉,或:
|
|
71
|
+
dsh plugin remove dsh-visualization
|
|
72
|
+
# npm 装的:
|
|
73
|
+
npm uninstall -g dsh-visualization
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
仪表盘不写任何持久状态;删除后 `~/.dsh/sessions` 里的日志原样不动。
|
|
77
|
+
|
|
78
|
+
## Can I use it at work? / 能在公司用吗?
|
|
79
|
+
|
|
80
|
+
**EN** — No. PolyForm Noncommercial excludes use by a for-profit company, including internal use
|
|
81
|
+
and use on behalf of a company. Personal study and noncommercial organisations (charities,
|
|
82
|
+
educational and public research institutions) are permitted by the license text.
|
|
83
|
+
|
|
84
|
+
**中文** — 不行。PolyForm Noncommercial 排除了在营利性公司内部或代表公司的使用。个人学习、
|
|
85
|
+
以及慈善、教育、公共研究机构等非商业组织,按许可条文是允许的。
|
package/README.md
CHANGED
|
@@ -36,6 +36,8 @@ rings, turns, tools and background jobs.
|
|
|
36
36
|
|
|
37
37
|
A ring icon appears in the left rail; click it to open the instrument.
|
|
38
38
|
|
|
39
|
+
Or from npm: pm i dsh-visualization (package: https://www.npmjs.com/package/dsh-visualization).
|
|
40
|
+
|
|
39
41
|
## Reading the panel
|
|
40
42
|
|
|
41
43
|
| Area | What it tells you |
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-visualization",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "DSH
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "DSH Visualization — a session instrument: rings, turns, tools and background jobs of a live DeepSeek Harness session.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"exports": {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"locale",
|
|
27
27
|
"icon.svg",
|
|
28
28
|
"LICENSE",
|
|
29
|
-
"README.md"
|
|
29
|
+
"README.md",
|
|
30
|
+
"FAQ.md"
|
|
30
31
|
],
|
|
31
32
|
"keywords": [
|
|
32
33
|
"dsh",
|
package/web/index.html
CHANGED
|
@@ -979,6 +979,21 @@ html,body{height:100%;overflow:hidden;background:var(--bg);color:var(--ink);
|
|
|
979
979
|
for (var cq = 0; cq < CHAIN_PREV.length; cq++) {
|
|
980
980
|
var ce = CHAIN_PREV[cq], cps = ce.pts;
|
|
981
981
|
for (var cp = 1; cp < cps.length; cp++) segLine(cps[cp - 1], cps[cp], ce.bright, ce.fr);
|
|
982
|
+
/* 用到技能的那一步:③ 上加发光环 + 两段高亮,否则技能环上永远是个空环 */
|
|
983
|
+
if (ce.skill) {
|
|
984
|
+
var sp = ce.skill, si = cps.indexOf(sp);
|
|
985
|
+
var hg = X.createRadialGradient(sp.x, sp.y, 0, sp.x, sp.y, 15);
|
|
986
|
+
hg.addColorStop(0, 'rgba(150,200,255,.42)');
|
|
987
|
+
hg.addColorStop(1, 'rgba(150,200,255,0)');
|
|
988
|
+
X.fillStyle = hg; X.beginPath(); X.arc(sp.x, sp.y, 15, 0, TAU); X.fill();
|
|
989
|
+
X.strokeStyle = 'rgba(160,205,255,.9)'; X.lineWidth = 1.8;
|
|
990
|
+
X.beginPath(); X.arc(sp.x, sp.y, 3.6, 0, TAU); X.stroke();
|
|
991
|
+
X.strokeStyle = 'rgba(150,200,255,.6)'; X.lineWidth = 2;
|
|
992
|
+
X.beginPath();
|
|
993
|
+
if (si > 0) { X.moveTo(cps[si - 1].x, cps[si - 1].y); X.lineTo(sp.x, sp.y); }
|
|
994
|
+
if (si >= 0 && si < cps.length - 1) { X.moveTo(sp.x, sp.y); X.lineTo(cps[si + 1].x, cps[si + 1].y); }
|
|
995
|
+
X.stroke();
|
|
996
|
+
}
|
|
982
997
|
/* 移动光点:按路径长度插值 */
|
|
983
998
|
var lens = [], tot = 0;
|
|
984
999
|
for (var cl = 1; cl < cps.length; cl++) {
|
|
@@ -1130,6 +1145,32 @@ html,body{height:100%;overflow:hidden;background:var(--bg);color:var(--ink);
|
|
|
1130
1145
|
});
|
|
1131
1146
|
}
|
|
1132
1147
|
}
|
|
1148
|
+
/* 技能是被调用的稀疏事件:给它一条自己的连线,别指望"某一步用了 skill"那条阶梯 */
|
|
1149
|
+
if (M.skills.length) {
|
|
1150
|
+
var nowSk = clockNow();
|
|
1151
|
+
var spanSk = RSPAN[1] || (M.sSteps && M.sSteps.length
|
|
1152
|
+
? Math.max(120000, nowSk - M.sSteps[0].t) : 120000);
|
|
1153
|
+
for (i = 0; i < M.skills.length && i < 16; i++) {
|
|
1154
|
+
var skI = M.skills[i];
|
|
1155
|
+
var aSk = rotOf(2, t) - Math.PI / 2 + TAU * i / 16;
|
|
1156
|
+
var px = ox + Math.cos(aSk) * rr, py = oy + Math.sin(aSk) * rr;
|
|
1157
|
+
var age = nowSk - (skI.last || 0);
|
|
1158
|
+
if (age >= 0 && age <= spanSk) {
|
|
1159
|
+
var aTo = -Math.PI / 2 + (age / spanSk) * TAU + rotOf(1, t);
|
|
1160
|
+
var qx = ox + Math.cos(aTo) * R[1], qy = oy + Math.sin(aTo) * R[1];
|
|
1161
|
+
X.strokeStyle = rgba(COL.skill, 0.8); X.lineWidth = 2.6;
|
|
1162
|
+
X.beginPath(); X.moveTo(px, py); X.lineTo(qx, qy); X.stroke();
|
|
1163
|
+
X.beginPath(); X.arc(qx, qy, 3, 0, TAU);
|
|
1164
|
+
X.fillStyle = rgba(COL.skill, 0.95); X.fill();
|
|
1165
|
+
}
|
|
1166
|
+
var hgS = X.createRadialGradient(px, py, 0, px, py, 19);
|
|
1167
|
+
hgS.addColorStop(0, rgba(COL.skill, 0.75));
|
|
1168
|
+
hgS.addColorStop(1, rgba(COL.skill, 0));
|
|
1169
|
+
X.fillStyle = hgS; X.beginPath(); X.arc(px, py, 19, 0, TAU); X.fill();
|
|
1170
|
+
X.beginPath(); X.arc(px, py, 4.2, 0, TAU);
|
|
1171
|
+
X.fillStyle = rgba(COL.skill, 0.95); X.fill();
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1133
1174
|
}
|
|
1134
1175
|
|
|
1135
1176
|
/* ④ 工具环:不看时间,看「构成」
|
|
@@ -1404,15 +1445,20 @@ html,body{height:100%;overflow:hidden;background:var(--bg);color:var(--ink);
|
|
|
1404
1445
|
return x5.turn === s5.turn && x5.step === s5.step;
|
|
1405
1446
|
});
|
|
1406
1447
|
var usedSkill = stepTools.some(function (x5) { return x5.name === 'skill'; });
|
|
1448
|
+
var skillPt = null;
|
|
1449
|
+
if (usedSkill) {
|
|
1450
|
+
/* ③ 技能环只落一个点,再向 ④ 扇开(原来每个工具都插一个 ③ 点,会来回跳) */
|
|
1451
|
+
var aK0 = (SKILL_ANG == null)
|
|
1452
|
+
? (segMap['skill'] != null ? segMap['skill'] : -Math.PI / 2)
|
|
1453
|
+
: SKILL_ANG;
|
|
1454
|
+
skillPt = { x: ox + Math.cos(aK0) * R[2], y: oy + Math.sin(aK0) * R[2] };
|
|
1455
|
+
path.push(skillPt);
|
|
1456
|
+
}
|
|
1407
1457
|
var used = 0;
|
|
1408
1458
|
for (var tj = 0; tj < stepTools.length && used < 12; tj++) {
|
|
1409
1459
|
var tl5 = stepTools[tj];
|
|
1410
1460
|
var aT5 = segMap[tl5.name];
|
|
1411
1461
|
if (aT5 == null) continue;
|
|
1412
|
-
if (usedSkill) {
|
|
1413
|
-
var aK = (SKILL_ANG == null) ? aT5 : SKILL_ANG;
|
|
1414
|
-
path.push({ x: ox + Math.cos(aK) * R[2], y: oy + Math.sin(aK) * R[2] });
|
|
1415
|
-
}
|
|
1416
1462
|
path.push({ x: ox + Math.cos(aT5) * R[3], y: oy + Math.sin(aT5) * R[3] });
|
|
1417
1463
|
used++;
|
|
1418
1464
|
}
|
|
@@ -1443,7 +1489,7 @@ html,body{height:100%;overflow:hidden;background:var(--bg);color:var(--ink);
|
|
|
1443
1489
|
/* 这里只攒几何,真正的绘制在下一帧开头(画环之前)完成 —— 线在环下面 */
|
|
1444
1490
|
if (path.length > 1) {
|
|
1445
1491
|
CHAIN_PREV.push({
|
|
1446
|
-
pts: path, bright: bright, fr: fr5,
|
|
1492
|
+
pts: path, bright: bright, fr: fr5, skill: skillPt,
|
|
1447
1493
|
phase: (i / Math.max(1, arr3.length)) * 0.8
|
|
1448
1494
|
});
|
|
1449
1495
|
}
|