dsh-visualization 0.1.4 → 0.1.5

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.
@@ -0,0 +1,65 @@
1
+ <!doctype html>
2
+ <html lang="zh">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>DSH Visualization</title>
6
+ <meta name="description" content="A live session instrument for DeepSeek Harness">
7
+ <style>
8
+ html, body { margin: 0; height: 100%; background: #0b0d11; overflow: hidden }
9
+ iframe { width: 100vw; height: 100vh; border: 0; display: block }
10
+ #msg {
11
+ position: fixed; inset: 0; display: none; flex-direction: column;
12
+ align-items: center; justify-content: center; gap: 12px;
13
+ color: #8d97ab; font: 15px/1.8 "Segoe UI", "Microsoft YaHei", sans-serif;
14
+ background: radial-gradient(circle at 50% 45%, #141a24, #0b0d11 70%);
15
+ text-align: center;
16
+ }
17
+ #msg b { color: #e6edfa; font-size: 19px; letter-spacing: .04em }
18
+ #msg code { color: #ffc46b; background: #1a1f29; padding: 2px 7px; border-radius: 4px; font-size: 13px }
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <iframe id="frame" src="about:blank"></iframe>
23
+ <div id="msg">
24
+ <b>DSH Visualization</b>
25
+ <div id="why">正在连接 DeepSeek Harness…</div>
26
+ <div>需要:装了 <code>dsh-visualization</code> 插件,并且 DSH 正在运行</div>
27
+ <div style="opacity:.6">每 5 秒自动重试</div>
28
+ </div>
29
+ <script>
30
+ /* 插件在固定端口 8799 开了入口(被占用时往下退) */
31
+ var PORTS = [8799, 8798, 8797, 8796, 8795];
32
+ var frame = document.getElementById('frame');
33
+ var msg = document.getElementById('msg');
34
+ var why = document.getElementById('why');
35
+ var ok = false, i = 0;
36
+
37
+ function probe() {
38
+ if (ok) return;
39
+ if (i >= PORTS.length) {
40
+ i = 0;
41
+ msg.style.display = 'flex';
42
+ why.textContent = '连不上插件端口(8799–8795)';
43
+ setTimeout(probe, 5000);
44
+ return;
45
+ }
46
+ var p = PORTS[i++];
47
+ var ctl = new AbortController();
48
+ var tm = setTimeout(function () { ctl.abort() }, 1500);
49
+ why.textContent = '正在尝试 ' + p + ' …';
50
+ fetch('http://127.0.0.1:' + p + '/state', { signal: ctl.signal, cache: 'no-store' })
51
+ .then(function (r) { return r.ok ? r.json() : null })
52
+ .then(function (j) {
53
+ clearTimeout(tm);
54
+ if (!j) return probe();
55
+ ok = true;
56
+ msg.style.display = 'none';
57
+ frame.src = 'http://127.0.0.1:' + p + '/';
58
+ })
59
+ .catch(function () { clearTimeout(tm); setTimeout(probe, 120); });
60
+ }
61
+ probe();
62
+ setInterval(function () { if (!ok) probe() }, 8000);
63
+ </script>
64
+ </body>
65
+ </html>
Binary file
Binary file
@@ -1,97 +0,0 @@
1
- <!doctype html>
2
- <html lang="zh">
3
- <head>
4
- <meta charset="utf-8">
5
- <style>
6
- :root{
7
- --bg:#0b0d11; --panel:#141922; --line:#232b38; --txt:#e6edfa; --dim:#8d97ab;
8
- --amber:#ffc46b; --mint:#8fe0c8; --coral:#ff7a5c; --violet:#b28cff; --sky:#7fb2ff;
9
- }
10
- *{box-sizing:border-box}
11
- html,body{margin:0;background:var(--bg);font:13px/1.6 "Segoe UI","Microsoft YaHei",sans-serif;color:var(--txt)}
12
- .wrap{width:1400px;padding:28px 30px 30px}
13
- h1{margin:0 0 4px;font-size:19px;letter-spacing:.04em}
14
- .sub{color:var(--dim);font-size:12.5px;margin-bottom:22px}
15
- .row{display:flex;gap:18px}
16
- .card{flex:1;background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:16px 16px 18px;position:relative}
17
- .n{position:absolute;top:-11px;left:16px;background:var(--bg);border:1px solid var(--line);color:var(--amber);
18
- font-size:11px;letter-spacing:.14em;padding:2px 9px;border-radius:20px}
19
- .t{font-size:13.5px;margin:6px 0 12px;font-weight:600}
20
- .muted{color:var(--dim)}
21
- .kbd{border:1px solid var(--line);background:#0f141c;border-radius:4px;padding:1px 6px;font-size:11.5px;color:var(--txt)}
22
- .mock{border:1px solid var(--line);border-radius:7px;overflow:hidden;background:#0f141c}
23
- .mock .bar{height:22px;background:#111721;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 8px;gap:5px}
24
- .dot{width:7px;height:7px;border-radius:50%;background:#2b3444}
25
- .mock .body{padding:10px}
26
- .opt{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:5px;border:1px solid transparent}
27
- .opt.sel{background:#1a2433;border-color:#2f4straight}
28
- .opt.sel{border-color:#3a4a63}
29
- .opt .ico{width:16px;height:16px;border-radius:3px;background:#2a3342}
30
- .opt.sel .ico{background:var(--sky)}
31
- .foot{margin-top:14px;display:flex;justify-content:space-between;align-items:center}
32
- .btn{background:#1d2634;border:1px solid var(--line);border-radius:5px;padding:5px 12px;font-size:12px;color:var(--dim)}
33
- .btn.on{background:var(--amber);border-color:var(--amber);color:#1a1206;font-weight:600}
34
- .path{font-family:Consolas,monospace;font-size:11.5px;color:var(--mint);background:#0f141c;border:1px solid var(--line);
35
- border-radius:4px;padding:5px 8px;display:block;margin-top:8px;word-break:break-all}
36
- .flow{margin-top:14px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11.5px}
37
- .node{border:1px solid var(--line);border-radius:5px;padding:4px 8px;background:#0f141c;color:var(--dim)}
38
- .node.hot{border-color:var(--amber);color:var(--amber)}
39
- .arw{color:#3d4757}
40
- .note{margin-top:12px;font-size:11.5px;color:var(--dim);border-left:2px solid var(--violet);padding-left:8px}
41
- </style>
42
- </head>
43
- <body>
44
- <div class="wrap">
45
- <h1>把 DSH Visualization 设成桌面壁纸</h1>
46
- <div class="sub">前提:已安装 dsh-visualization 插件,并且 DSH 正在运行 · Wallpaper Engine(Steam)</div>
47
-
48
- <div class="row">
49
- <div class="card">
50
- <div class="n">STEP 1</div>
51
- <div class="t">在 Wallpaper Engine 里新建壁纸</div>
52
- <div class="mock">
53
- <div class="bar"><span class="dot"></span><span class="dot"></span><span class="dot"></span></div>
54
- <div class="body">
55
- <div class="opt"><span class="ico"></span>场景 Scene</div>
56
- <div class="opt"><span class="ico"></span>视频 Video</div>
57
- <div class="opt sel"><span class="ico"></span><b>网页 Web</b></div>
58
- <div class="opt"><span class="ico"></span>应用程序 Application</div>
59
- </div>
60
- </div>
61
- <div class="note">点左下角 <span class="kbd">创建壁纸</span>,类型选 <b>网页</b>。</div>
62
- </div>
63
-
64
- <div class="card">
65
- <div class="n">STEP 2</div>
66
- <div class="t">选中仓库里的壁纸入口</div>
67
- <div class="mock" style="padding:12px 12px 14px">
68
- <div class="muted" style="font-size:11.5px">选择文件</div>
69
- <span class="path">wallpaper&#92;index.html</span>
70
- <div class="muted" style="font-size:11.5px;margin-top:10px">同目录还有(不用选)</div>
71
- <span class="path" style="color:var(--dim)">project.json · preview.jpg</span>
72
- </div>
73
- <div class="note">路径来自你安装插件的目录,通常在<br><span style="color:var(--dim)">…/profiles/desktop/node_modules/dsh-visualization/wallpaper/</span></div>
74
- </div>
75
-
76
- <div class="card">
77
- <div class="n">STEP 3</div>
78
- <div class="t">直接应用,不用配置</div>
79
- <div class="flow">
80
- <span class="node">DSH 随机端口<br><span style="opacity:.6">:1233 :7632 …</span></span>
81
- <span class="arw">→</span>
82
- <span class="node hot">插件固定端口<br>127.0.0.1:8799</span>
83
- <span class="arw">→</span>
84
- <span class="node">壁纸</span>
85
- </div>
86
- <div class="note">壁纸只会访问 <b>8799</b>;插件在内部转发到这次 DSH 的真实端口。
87
- 连不上时壁纸显示提示,每 5 秒重试一次,DSH 换端口后会自动找到。</div>
88
- </div>
89
- </div>
90
-
91
- <div class="sub" style="margin-top:20px;margin-bottom:0">
92
- 端口 8799 被占用时插件会依次退到 8798 / 8797 / 8796 / 8795;要固定成别的,在插件配置里写
93
- <span class="kbd">wallpaperPort</span>,同时改 <span class="kbd">wallpaper/index.html</span> 里的 PORTS 数组。
94
- </div>
95
- </div>
96
- </body>
97
- </html>
@@ -1,62 +0,0 @@
1
- <!doctype html>
2
- <html lang="zh">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>DSH Visualization</title>
6
- <style>
7
- html, body { margin: 0; height: 100%; background: #0b0d11; overflow: hidden; }
8
- iframe { width: 100vw; height: 100vh; border: 0; display: block; }
9
- #off {
10
- position: fixed; inset: 0; display: none; flex-direction: column;
11
- align-items: center; justify-content: center; gap: 14px;
12
- color: #8d97ab; font: 15px/1.7 "Segoe UI", "Microsoft YaHei", sans-serif;
13
- background: radial-gradient(circle at 50% 45%, #141a24, #0b0d11 70%);
14
- text-align: center;
15
- }
16
- #off b { color: #e6edfa; font-size: 19px; font-weight: 600; letter-spacing: .04em; }
17
- #off code { color: #ffc46b; background: #1a1f29; padding: 2px 7px; border-radius: 4px; font-size: 13px; }
18
- </style>
19
- </head>
20
- <body>
21
- <iframe id="frame" allow="cross-origin-isolated"></iframe>
22
- <div id="off">
23
- <b>DSH Visualization</b>
24
- <div>没有连上 DeepSeek Harness。</div>
25
- <div>请确认:装了 <code>dsh-visualization</code> 插件,并且 DSH 正在运行。</div>
26
- <div style="opacity:.65">每 5 秒自动重试</div>
27
- </div>
28
- <script>
29
- /* 插件的壁纸入口固定在这个区间(8799 起,被占用依次往下) */
30
- var PORTS = [8799, 8798, 8797, 8796, 8795];
31
- var frame = document.getElementById('frame');
32
- var off = document.getElementById('off');
33
- var chosen = 0;
34
-
35
- function probe() {
36
- var i = 0;
37
- function next() {
38
- if (i >= PORTS.length) { frame.style.display = 'none'; off.style.display = 'flex'; chosen = 0; return; }
39
- var p = PORTS[i++];
40
- var ctl = new AbortController();
41
- var timer = setTimeout(function () { ctl.abort() }, 1200);
42
- fetch('http://127.0.0.1:' + p + '/state', { signal: ctl.signal, cache: 'no-store' })
43
- .then(function (r) { return r.ok ? r.json() : null })
44
- .then(function (j) {
45
- clearTimeout(timer);
46
- if (!j) return next();
47
- chosen = p;
48
- off.style.display = 'none';
49
- frame.style.display = 'block';
50
- if (frame.src.indexOf(':' + p + '/') < 0) frame.src = 'http://127.0.0.1:' + p + '/';
51
- })
52
- .catch(function () { clearTimeout(timer); next(); });
53
- }
54
- next();
55
- }
56
-
57
- probe();
58
- /* 断线后自动重连:DSH 重启会换端口,所以每次都重新探测 */
59
- setInterval(function () { if (!chosen) probe(); }, 5000);
60
- </script>
61
- </body>
62
- </html>