dsh-all-usage 1.2.2 → 1.2.4

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.de.md +316 -0
  3. package/README.en.md +52 -14
  4. package/README.es.md +316 -0
  5. package/README.fr.md +316 -0
  6. package/README.ja.md +316 -0
  7. package/README.md +55 -17
  8. package/README.pt.md +316 -0
  9. package/README.ru.md +316 -0
  10. package/assets/cover-en.png +0 -0
  11. package/assets/cover-zh.png +0 -0
  12. package/assets/readme-architecture-en.svg +95 -95
  13. package/assets/readme-architecture-zh.svg +95 -95
  14. package/assets/readme-sync-en.svg +81 -81
  15. package/assets/readme-sync-zh.svg +81 -81
  16. package/assets/screenshots/en/01-overview.png +0 -0
  17. package/assets/screenshots/en/02-trend-bars.png +0 -0
  18. package/assets/screenshots/en/02-trend.png +0 -0
  19. package/assets/screenshots/en/03-heatmap.png +0 -0
  20. package/assets/screenshots/en/04-model-stats.png +0 -0
  21. package/assets/screenshots/en/05-request-logs.png +0 -0
  22. package/assets/screenshots/en/06-cost-settings.png +0 -0
  23. package/assets/screenshots/en/07-maintenance.png +0 -0
  24. package/assets/screenshots/zh/01-overview.png +0 -0
  25. package/assets/screenshots/zh/02-trend-bars.png +0 -0
  26. package/assets/screenshots/zh/02-trend.png +0 -0
  27. package/assets/screenshots/zh/03-heatmap.png +0 -0
  28. package/assets/screenshots/zh/04-model-stats.png +0 -0
  29. package/assets/screenshots/zh/05-request-logs.png +0 -0
  30. package/assets/screenshots/zh/06-cost-settings.png +0 -0
  31. package/assets/screenshots/zh/07-maintenance.png +0 -0
  32. package/lib/archive.js +399 -0
  33. package/lib/client.js +1 -1
  34. package/lib/http.js +27 -1
  35. package/lib/ledger.js +362 -54
  36. package/package.json +10 -1
  37. package/screenshots.json +7 -9
  38. package/scripts/archive-ledger.mjs +156 -0
  39. package/assets/screenshots/en/04-model-usage.png +0 -0
  40. package/assets/screenshots/zh/04-model-usage.png +0 -0
@@ -1,95 +1,95 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" lang="en" width="1600" height="1000" viewBox="0 0 1600 1000" role="img" aria-labelledby="arch-en-title arch-en-desc">
2
- <title id="arch-en-title">All Usage · System Architecture</title>
3
- <desc id="arch-en-desc">From DSH sessions and ledger to protected HTTP APIs and the dashboard client</desc>
4
- <defs>
5
- <pattern id="arch-en-dots" width="32" height="32" patternUnits="userSpaceOnUse">
6
- <circle cx="2" cy="2" r="1.5" fill="#dce2e9"/></pattern>
7
- <marker id="arch-en-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
8
- <path d="M 0 0 L 10 5 L 0 10 z" fill="#6c7a8d"/></marker></defs>
9
- <rect width="100%" height="100%" fill="#fbfcfe"/>
10
- <rect width="100%" height="100%" fill="url(#arch-en-dots)"/>
11
- <circle cx="72" cy="74" r="15" fill="#2c99ad" opacity=".18"/>
12
- <circle cx="72" cy="74" r="7" fill="#2c99ad"/>
13
- <text x="102" y="81" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="34" font-weight="700" fill="#1b2638">All Usage · System Architecture</text>
14
- <text x="102" y="119" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" fill="#637083">From DSH sessions and ledger to protected HTTP APIs and the dashboard client</text>
15
- <g>
16
- <rect x="55" y="180" width="320" height="740" rx="22" fill="#f8fafc" stroke="#738195" stroke-width="2"/>
17
- <text x="77" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#586578">DSH inputs</text></g>
18
- <g>
19
- <rect x="410" y="180" width="680" height="740" rx="22" fill="#f4fbf7" stroke="#299572" stroke-width="2"/>
20
- <text x="432" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#586578">Host services</text></g>
21
- <g>
22
- <rect x="1125" y="180" width="420" height="740" rx="22" fill="#faf8fd" stroke="#885bd0" stroke-width="2"/>
23
- <text x="1147" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#586578">Persistence, API, and UI</text></g>
24
- <path d="M350 420 H400 V390 H475" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
25
- <path d="M720 390 H790" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
26
- <path d="M1035 390 H1170" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
27
- <path d="M912 465 V660" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
28
- <path d="M350 790 H475" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
29
- <path d="M720 735 H790" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
30
- <path d="M1035 735 H1100 V575 H1170" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
31
- <path d="M1340 425 V510" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
32
- <path d="M1340 662 V740" fill="none" stroke="#6c7a8d" stroke-width="2.5" marker-start="url(#arch-en-arrow)" marker-end="url(#arch-en-arrow)"/>
33
- <path d="M597 810 V858 H1145 V620 H1170" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
34
- <g>
35
- <rect x="85" y="305" width="260" height="230" rx="18" fill="#e9edf2" stroke="#738195" stroke-width="2.5"/>
36
- <rect x="99" y="319" width="5" height="202" rx="2.5" fill="#738195" opacity=".42"/>
37
- <text x="215" y="392" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="215">Session data</tspan><tspan x="215" dy="25" font-size="14" font-weight="450" fill="#596579">Persisted history logs</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#596579">Live session/event</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#596579">Registered workspace registry</tspan></text></g>
38
- <g>
39
- <rect x="85" y="715" width="260" height="150" rx="18" fill="#e9edf2" stroke="#738195" stroke-width="2.5"/>
40
- <rect x="99" y="729" width="5" height="122" rx="2.5" fill="#738195" opacity=".42"/>
41
- <text x="215" y="773.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="215">Pricing and credentials</tspan><tspan x="215" dy="25" font-size="14" font-weight="450" fill="#596579">models.dev / manual prices</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#596579">DSH DeepSeek API key</tspan></text></g>
42
- <g>
43
- <rect x="475" y="315" width="245" height="150" rx="18" fill="#dcf4e8" stroke="#299572" stroke-width="2.5"/>
44
- <rect x="489" y="329" width="5" height="122" rx="2.5" fill="#299572" opacity=".42"/>
45
- <text x="597.5" y="373.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="597.5">History / live sync</tspan><tspan x="597.5" dy="25" font-size="14" font-weight="450" fill="#596579">Scan changed sessions</tspan><tspan x="597.5" dy="22" font-size="14" font-weight="450" fill="#596579">Fold live events</tspan></text></g>
46
- <g>
47
- <rect x="790" y="315" width="245" height="150" rx="18" fill="#dcf4e8" stroke="#299572" stroke-width="2.5"/>
48
- <rect x="804" y="329" width="5" height="122" rx="2.5" fill="#299572" opacity=".42"/>
49
- <text x="912.5" y="373.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="912.5">Usage normalization</tspan><tspan x="912.5" dy="25" font-size="14" font-weight="450" fill="#596579">Turn/step dedupe + replace</tspan><tspan x="912.5" dy="22" font-size="14" font-weight="450" fill="#596579">Model identity · token buckets</tspan></text></g>
50
- <g>
51
- <rect x="475" y="660" width="245" height="150" rx="18" fill="#dcf4e8" stroke="#299572" stroke-width="2.5"/>
52
- <rect x="489" y="674" width="5" height="122" rx="2.5" fill="#299572" opacity=".42"/>
53
- <text x="597.5" y="718.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="597.5">Pricing / balance</tspan><tspan x="597.5" dy="25" font-size="14" font-weight="450" fill="#596579">Four-bucket cost estimate</tspan><tspan x="597.5" dy="22" font-size="14" font-weight="450" fill="#596579">Account balance query</tspan></text></g>
54
- <g>
55
- <rect x="790" y="660" width="245" height="150" rx="18" fill="#dcf4e8" stroke="#299572" stroke-width="2.5"/>
56
- <rect x="804" y="674" width="5" height="122" rx="2.5" fill="#299572" opacity=".42"/>
57
- <text x="912.5" y="718.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="912.5">Scoped aggregation</tspan><tspan x="912.5" dy="25" font-size="14" font-weight="450" fill="#596579">Summary · trend · heatmap</tspan><tspan x="912.5" dy="22" font-size="14" font-weight="450" fill="#596579">Daily/hourly · paginated rows</tspan></text></g>
58
- <g>
59
- <rect x="1170" y="275" width="340" height="150" rx="18" fill="#eee5fc" stroke="#885bd0" stroke-width="2.5"/>
60
- <rect x="1184" y="289" width="5" height="122" rx="2.5" fill="#885bd0" opacity=".42"/>
61
- <text x="1340" y="333.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="1340">Per-session ledger</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#596579">One durable document per session</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#596579">Request details loaded by page</tspan></text></g>
62
- <g>
63
- <rect x="1170" y="510" width="340" height="152" rx="18" fill="#ffe9dc" stroke="#df7446" stroke-width="2.5"/>
64
- <rect x="1184" y="524" width="5" height="124" rx="2.5" fill="#df7446" opacity=".42"/>
65
- <text x="1340" y="558.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="1340">Host HTTP API</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#596579">Loopback only</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#596579">Workspace/model-scoped queries</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#596579">Writes use a process-scoped token</tspan></text></g>
66
- <g>
67
- <rect x="1170" y="740" width="340" height="145" rx="18" fill="#def2f7" stroke="#298da8" stroke-width="2.5"/>
68
- <rect x="1184" y="754" width="5" height="117" rx="2.5" fill="#298da8" opacity=".42"/>
69
- <text x="1340" y="796" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="1340">Dashboard client</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#596579">Filters · charts · request log</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#596579">CSV export</tspan></text></g>
70
- <g>
71
- <rect x="724" y="345" width="62" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
72
- <text x="755" y="365" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">usage</text></g>
73
- <g>
74
- <rect x="867.5" y="545" width="169" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
75
- <text x="952" y="565" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">scoped query</text></g>
76
- <g>
77
- <rect x="724" y="690" width="62" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
78
- <text x="755" y="710" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">rates</text></g>
79
- <g>
80
- <rect x="1324.5" y="451" width="145" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
81
- <text x="1397" y="471" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">paged rows</text></g>
82
- <g>
83
- <rect x="1360" y="674" width="150" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
84
- <text x="1435" y="694" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">request / result</text></g>
85
- <g>
86
- <rect x="770" y="833" width="200" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
87
- <text x="870" y="853" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">Pricing / balance</text></g>
88
- <rect x="480" y="943" width="22" height="18" rx="5" fill="#e9edf2" stroke="#738195" stroke-width="2"/>
89
- <text x="512" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#536174">DSH inputs</text>
90
- <rect x="690" y="943" width="22" height="18" rx="5" fill="#dcf4e8" stroke="#299572" stroke-width="2"/>
91
- <text x="722" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#536174">Host processing</text>
92
- <rect x="930" y="943" width="22" height="18" rx="5" fill="#eee5fc" stroke="#885bd0" stroke-width="2"/>
93
- <text x="962" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#536174">Persistence</text>
94
- <rect x="1150" y="943" width="22" height="18" rx="5" fill="#ffe9dc" stroke="#df7446" stroke-width="2"/>
95
- <text x="1182" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#536174">API / UI</text></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" lang="en" width="1600" height="1000" viewBox="0 0 1600 1000" role="img" aria-labelledby="arch-en-title arch-en-desc">
2
+ <title id="arch-en-title">All Usage · System Architecture</title>
3
+ <desc id="arch-en-desc">From DSH sessions and ledger to protected HTTP APIs and the dashboard client</desc>
4
+ <defs>
5
+ <pattern id="arch-en-dots" width="32" height="32" patternUnits="userSpaceOnUse">
6
+ <circle cx="2" cy="2" r="1.5" fill="#242b35"/></pattern>
7
+ <marker id="arch-en-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
8
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="#7f8a9a"/></marker></defs>
9
+ <rect width="100%" height="100%" fill="#0f1216"/>
10
+ <rect width="100%" height="100%" fill="url(#arch-en-dots)"/>
11
+ <circle cx="72" cy="74" r="15" fill="#4fb3c6" opacity=".18"/>
12
+ <circle cx="72" cy="74" r="7" fill="#4fb3c6"/>
13
+ <text x="102" y="81" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="34" font-weight="700" fill="#f5f7fa">All Usage · System Architecture</text>
14
+ <text x="102" y="119" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" fill="#9aa6b6">From DSH sessions and ledger to protected HTTP APIs and the dashboard client</text>
15
+ <g>
16
+ <rect x="55" y="180" width="320" height="740" rx="22" fill="#151a21" stroke="#8b95a5" stroke-width="2"/>
17
+ <text x="77" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#9aa6b6">DSH inputs</text></g>
18
+ <g>
19
+ <rect x="410" y="180" width="680" height="740" rx="22" fill="#101c19" stroke="#3fae86" stroke-width="2"/>
20
+ <text x="432" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#9aa6b6">Host services</text></g>
21
+ <g>
22
+ <rect x="1125" y="180" width="420" height="740" rx="22" fill="#17141f" stroke="#9b74dd" stroke-width="2"/>
23
+ <text x="1147" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#9aa6b6">Persistence, API, and UI</text></g>
24
+ <path d="M350 420 H400 V390 H475" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
25
+ <path d="M720 390 H790" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
26
+ <path d="M1035 390 H1170" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
27
+ <path d="M912 465 V660" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
28
+ <path d="M350 790 H475" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
29
+ <path d="M720 735 H790" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
30
+ <path d="M1035 735 H1100 V575 H1170" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
31
+ <path d="M1340 425 V510" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
32
+ <path d="M1340 662 V740" fill="none" stroke="#7f8a9a" stroke-width="2.5" marker-start="url(#arch-en-arrow)" marker-end="url(#arch-en-arrow)"/>
33
+ <path d="M597 810 V858 H1145 V620 H1170" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-en-arrow)"/>
34
+ <g>
35
+ <rect x="85" y="305" width="260" height="230" rx="18" fill="#232a34" stroke="#8b95a5" stroke-width="2.5"/>
36
+ <rect x="99" y="319" width="5" height="202" rx="2.5" fill="#8b95a5" opacity=".42"/>
37
+ <text x="215" y="392" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="215">Session data</tspan><tspan x="215" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">Persisted history logs</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">Live session/event</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">Registered workspace registry</tspan></text></g>
38
+ <g>
39
+ <rect x="85" y="715" width="260" height="150" rx="18" fill="#232a34" stroke="#8b95a5" stroke-width="2.5"/>
40
+ <rect x="99" y="729" width="5" height="122" rx="2.5" fill="#8b95a5" opacity=".42"/>
41
+ <text x="215" y="773.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="215">Pricing and credentials</tspan><tspan x="215" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">models.dev / manual prices</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">DSH DeepSeek API key</tspan></text></g>
42
+ <g>
43
+ <rect x="475" y="315" width="245" height="150" rx="18" fill="#12302a" stroke="#3fae86" stroke-width="2.5"/>
44
+ <rect x="489" y="329" width="5" height="122" rx="2.5" fill="#3fae86" opacity=".42"/>
45
+ <text x="597.5" y="373.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="597.5">History / live sync</tspan><tspan x="597.5" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">Scan changed sessions</tspan><tspan x="597.5" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">Fold live events</tspan></text></g>
46
+ <g>
47
+ <rect x="790" y="315" width="245" height="150" rx="18" fill="#12302a" stroke="#3fae86" stroke-width="2.5"/>
48
+ <rect x="804" y="329" width="5" height="122" rx="2.5" fill="#3fae86" opacity=".42"/>
49
+ <text x="912.5" y="373.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="912.5">Usage normalization</tspan><tspan x="912.5" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">Turn/step dedupe + replace</tspan><tspan x="912.5" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">Model identity · token buckets</tspan></text></g>
50
+ <g>
51
+ <rect x="475" y="660" width="245" height="150" rx="18" fill="#12302a" stroke="#3fae86" stroke-width="2.5"/>
52
+ <rect x="489" y="674" width="5" height="122" rx="2.5" fill="#3fae86" opacity=".42"/>
53
+ <text x="597.5" y="718.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="597.5">Pricing / balance</tspan><tspan x="597.5" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">Four-bucket cost estimate</tspan><tspan x="597.5" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">Account balance query</tspan></text></g>
54
+ <g>
55
+ <rect x="790" y="660" width="245" height="150" rx="18" fill="#12302a" stroke="#3fae86" stroke-width="2.5"/>
56
+ <rect x="804" y="674" width="5" height="122" rx="2.5" fill="#3fae86" opacity=".42"/>
57
+ <text x="912.5" y="718.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="912.5">Scoped aggregation</tspan><tspan x="912.5" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">Summary · trend · heatmap</tspan><tspan x="912.5" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">Daily/hourly · paginated rows</tspan></text></g>
58
+ <g>
59
+ <rect x="1170" y="275" width="340" height="150" rx="18" fill="#241d3a" stroke="#9b74dd" stroke-width="2.5"/>
60
+ <rect x="1184" y="289" width="5" height="122" rx="2.5" fill="#9b74dd" opacity=".42"/>
61
+ <text x="1340" y="333.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="1340">Per-session ledger</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">One durable document per session</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">Request details loaded by page</tspan></text></g>
62
+ <g>
63
+ <rect x="1170" y="510" width="340" height="152" rx="18" fill="#3a2317" stroke="#e88a5f" stroke-width="2.5"/>
64
+ <rect x="1184" y="524" width="5" height="124" rx="2.5" fill="#e88a5f" opacity=".42"/>
65
+ <text x="1340" y="558.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="1340">Host HTTP API</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">Loopback only</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">Workspace/model-scoped queries</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">Writes use a process-scoped token</tspan></text></g>
66
+ <g>
67
+ <rect x="1170" y="740" width="340" height="145" rx="18" fill="#0f2c35" stroke="#47b0c9" stroke-width="2.5"/>
68
+ <rect x="1184" y="754" width="5" height="117" rx="2.5" fill="#47b0c9" opacity=".42"/>
69
+ <text x="1340" y="796" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="1340">Dashboard client</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">Filters · charts · request log</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">CSV export</tspan></text></g>
70
+ <g>
71
+ <rect x="724" y="345" width="62" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
72
+ <text x="755" y="365" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">usage</text></g>
73
+ <g>
74
+ <rect x="867.5" y="545" width="169" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
75
+ <text x="952" y="565" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">scoped query</text></g>
76
+ <g>
77
+ <rect x="724" y="690" width="62" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
78
+ <text x="755" y="710" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">rates</text></g>
79
+ <g>
80
+ <rect x="1324.5" y="451" width="145" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
81
+ <text x="1397" y="471" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">paged rows</text></g>
82
+ <g>
83
+ <rect x="1360" y="674" width="150" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
84
+ <text x="1435" y="694" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">request / result</text></g>
85
+ <g>
86
+ <rect x="770" y="833" width="200" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
87
+ <text x="870" y="853" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">Pricing / balance</text></g>
88
+ <rect x="480" y="943" width="22" height="18" rx="5" fill="#232a34" stroke="#8b95a5" stroke-width="2"/>
89
+ <text x="512" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#a3adbb">DSH inputs</text>
90
+ <rect x="690" y="943" width="22" height="18" rx="5" fill="#12302a" stroke="#3fae86" stroke-width="2"/>
91
+ <text x="722" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#a3adbb">Host processing</text>
92
+ <rect x="930" y="943" width="22" height="18" rx="5" fill="#241d3a" stroke="#9b74dd" stroke-width="2"/>
93
+ <text x="962" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#a3adbb">Persistence</text>
94
+ <rect x="1150" y="943" width="22" height="18" rx="5" fill="#3a2317" stroke="#e88a5f" stroke-width="2"/>
95
+ <text x="1182" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#a3adbb">API / UI</text></svg>
@@ -1,95 +1,95 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" lang="zh-CN" width="1600" height="1000" viewBox="0 0 1600 1000" role="img" aria-labelledby="arch-zh-title arch-zh-desc">
2
- <title id="arch-zh-title">用量看板 · 系统架构</title>
3
- <desc id="arch-zh-desc">从 DSH 会话与账本到受保护的 HTTP API 和 Dashboard Client</desc>
4
- <defs>
5
- <pattern id="arch-zh-dots" width="32" height="32" patternUnits="userSpaceOnUse">
6
- <circle cx="2" cy="2" r="1.5" fill="#dce2e9"/></pattern>
7
- <marker id="arch-zh-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
8
- <path d="M 0 0 L 10 5 L 0 10 z" fill="#6c7a8d"/></marker></defs>
9
- <rect width="100%" height="100%" fill="#fbfcfe"/>
10
- <rect width="100%" height="100%" fill="url(#arch-zh-dots)"/>
11
- <circle cx="72" cy="74" r="15" fill="#2c99ad" opacity=".18"/>
12
- <circle cx="72" cy="74" r="7" fill="#2c99ad"/>
13
- <text x="102" y="81" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="34" font-weight="700" fill="#1b2638">用量看板 · 系统架构</text>
14
- <text x="102" y="119" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" fill="#637083">从 DSH 会话与账本到受保护的 HTTP API 和 Dashboard Client</text>
15
- <g>
16
- <rect x="55" y="180" width="320" height="740" rx="22" fill="#f8fafc" stroke="#738195" stroke-width="2"/>
17
- <text x="77" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#586578">DSH 输入</text></g>
18
- <g>
19
- <rect x="410" y="180" width="680" height="740" rx="22" fill="#f4fbf7" stroke="#299572" stroke-width="2"/>
20
- <text x="432" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#586578">Host 服务</text></g>
21
- <g>
22
- <rect x="1125" y="180" width="420" height="740" rx="22" fill="#faf8fd" stroke="#885bd0" stroke-width="2"/>
23
- <text x="1147" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#586578">持久化、API 与界面</text></g>
24
- <path d="M350 420 H400 V390 H475" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
25
- <path d="M720 390 H790" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
26
- <path d="M1035 390 H1170" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
27
- <path d="M912 465 V660" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
28
- <path d="M350 790 H475" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
29
- <path d="M720 735 H790" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
30
- <path d="M1035 735 H1100 V575 H1170" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
31
- <path d="M1340 425 V510" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
32
- <path d="M1340 662 V740" fill="none" stroke="#6c7a8d" stroke-width="2.5" marker-start="url(#arch-zh-arrow)" marker-end="url(#arch-zh-arrow)"/>
33
- <path d="M597 810 V858 H1145 V620 H1170" fill="none" stroke="#6c7a8d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
34
- <g>
35
- <rect x="85" y="305" width="260" height="230" rx="18" fill="#e9edf2" stroke="#738195" stroke-width="2.5"/>
36
- <rect x="99" y="319" width="5" height="202" rx="2.5" fill="#738195" opacity=".42"/>
37
- <text x="215" y="392" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="215">会话数据</tspan><tspan x="215" dy="25" font-size="14" font-weight="450" fill="#596579">持久化历史日志</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#596579">实时 session/event</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#596579">注册工作区 registry</tspan></text></g>
38
- <g>
39
- <rect x="85" y="715" width="260" height="150" rx="18" fill="#e9edf2" stroke="#738195" stroke-width="2.5"/>
40
- <rect x="99" y="729" width="5" height="122" rx="2.5" fill="#738195" opacity=".42"/>
41
- <text x="215" y="773.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="215">定价与密钥</tspan><tspan x="215" dy="25" font-size="14" font-weight="450" fill="#596579">models.dev / 手动价格</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#596579">DSH DeepSeek 密钥</tspan></text></g>
42
- <g>
43
- <rect x="475" y="315" width="245" height="150" rx="18" fill="#dcf4e8" stroke="#299572" stroke-width="2.5"/>
44
- <rect x="489" y="329" width="5" height="122" rx="2.5" fill="#299572" opacity=".42"/>
45
- <text x="597.5" y="373.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="597.5">历史 / 实时同步</tspan><tspan x="597.5" dy="25" font-size="14" font-weight="450" fill="#596579">扫描变化会话</tspan><tspan x="597.5" dy="22" font-size="14" font-weight="450" fill="#596579">折叠实时事件</tspan></text></g>
46
- <g>
47
- <rect x="790" y="315" width="245" height="150" rx="18" fill="#dcf4e8" stroke="#299572" stroke-width="2.5"/>
48
- <rect x="804" y="329" width="5" height="122" rx="2.5" fill="#299572" opacity=".42"/>
49
- <text x="912.5" y="373.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="912.5">用量归一化</tspan><tspan x="912.5" dy="25" font-size="14" font-weight="450" fill="#596579">turn/step 去重与替换</tspan><tspan x="912.5" dy="22" font-size="14" font-weight="450" fill="#596579">解析模型身份与 Token 桶</tspan></text></g>
50
- <g>
51
- <rect x="475" y="660" width="245" height="150" rx="18" fill="#dcf4e8" stroke="#299572" stroke-width="2.5"/>
52
- <rect x="489" y="674" width="5" height="122" rx="2.5" fill="#299572" opacity=".42"/>
53
- <text x="597.5" y="718.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="597.5">定价 / 余额</tspan><tspan x="597.5" dy="25" font-size="14" font-weight="450" fill="#596579">四桶成本估算</tspan><tspan x="597.5" dy="22" font-size="14" font-weight="450" fill="#596579">账户余额查询</tspan></text></g>
54
- <g>
55
- <rect x="790" y="660" width="245" height="150" rx="18" fill="#dcf4e8" stroke="#299572" stroke-width="2.5"/>
56
- <rect x="804" y="674" width="5" height="122" rx="2.5" fill="#299572" opacity=".42"/>
57
- <text x="912.5" y="718.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="912.5">范围聚合</tspan><tspan x="912.5" dy="25" font-size="14" font-weight="450" fill="#596579">summary · trend · heatmap</tspan><tspan x="912.5" dy="22" font-size="14" font-weight="450" fill="#596579">daily/hourly · 分页明细</tspan></text></g>
58
- <g>
59
- <rect x="1170" y="275" width="340" height="150" rx="18" fill="#eee5fc" stroke="#885bd0" stroke-width="2.5"/>
60
- <rect x="1184" y="289" width="5" height="122" rx="2.5" fill="#885bd0" opacity=".42"/>
61
- <text x="1340" y="333.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="1340">逐会话账本</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#596579">每个 session 独立文档</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#596579">请求明细按需分页读取</tspan></text></g>
62
- <g>
63
- <rect x="1170" y="510" width="340" height="152" rx="18" fill="#ffe9dc" stroke="#df7446" stroke-width="2.5"/>
64
- <rect x="1184" y="524" width="5" height="124" rx="2.5" fill="#df7446" opacity=".42"/>
65
- <text x="1340" y="558.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="1340">Host HTTP API</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#596579">仅限 loopback 访问</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#596579">查询限定工作区与模型</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#596579">写入使用进程级令牌</tspan></text></g>
66
- <g>
67
- <rect x="1170" y="740" width="340" height="145" rx="18" fill="#def2f7" stroke="#298da8" stroke-width="2.5"/>
68
- <rect x="1184" y="754" width="5" height="117" rx="2.5" fill="#298da8" opacity=".42"/>
69
- <text x="1340" y="796" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#1e293b"><tspan x="1340">Dashboard Client</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#596579">筛选 · 图表 · 请求日志</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#596579">CSV 导出</tspan></text></g>
70
- <g>
71
- <rect x="724" y="345" width="62" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
72
- <text x="755" y="365" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">usage</text></g>
73
- <g>
74
- <rect x="914" y="545" width="76" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
75
- <text x="952" y="565" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">聚合查询</text></g>
76
- <g>
77
- <rect x="724" y="690" width="62" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
78
- <text x="755" y="710" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">费率</text></g>
79
- <g>
80
- <rect x="1359" y="451" width="76" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
81
- <text x="1397" y="471" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">分页明细</text></g>
82
- <g>
83
- <rect x="1360" y="674" width="150" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
84
- <text x="1435" y="694" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">请求 / 结果</text></g>
85
- <g>
86
- <rect x="770" y="833" width="200" height="30" rx="15" fill="#fff" stroke="#d7dde5" stroke-width="1.4"/>
87
- <text x="870" y="853" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#5e6b7d">定价 / 余额</text></g>
88
- <rect x="480" y="943" width="22" height="18" rx="5" fill="#e9edf2" stroke="#738195" stroke-width="2"/>
89
- <text x="512" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#536174">DSH 输入</text>
90
- <rect x="690" y="943" width="22" height="18" rx="5" fill="#dcf4e8" stroke="#299572" stroke-width="2"/>
91
- <text x="722" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#536174">Host 处理</text>
92
- <rect x="930" y="943" width="22" height="18" rx="5" fill="#eee5fc" stroke="#885bd0" stroke-width="2"/>
93
- <text x="962" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#536174">持久化</text>
94
- <rect x="1150" y="943" width="22" height="18" rx="5" fill="#ffe9dc" stroke="#df7446" stroke-width="2"/>
95
- <text x="1182" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#536174">API / 界面</text></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" lang="zh-CN" width="1600" height="1000" viewBox="0 0 1600 1000" role="img" aria-labelledby="arch-zh-title arch-zh-desc">
2
+ <title id="arch-zh-title">用量看板 · 系统架构</title>
3
+ <desc id="arch-zh-desc">从 DSH 会话与账本到受保护的 HTTP API 和 Dashboard Client</desc>
4
+ <defs>
5
+ <pattern id="arch-zh-dots" width="32" height="32" patternUnits="userSpaceOnUse">
6
+ <circle cx="2" cy="2" r="1.5" fill="#242b35"/></pattern>
7
+ <marker id="arch-zh-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
8
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="#7f8a9a"/></marker></defs>
9
+ <rect width="100%" height="100%" fill="#0f1216"/>
10
+ <rect width="100%" height="100%" fill="url(#arch-zh-dots)"/>
11
+ <circle cx="72" cy="74" r="15" fill="#4fb3c6" opacity=".18"/>
12
+ <circle cx="72" cy="74" r="7" fill="#4fb3c6"/>
13
+ <text x="102" y="81" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="34" font-weight="700" fill="#f5f7fa">用量看板 · 系统架构</text>
14
+ <text x="102" y="119" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" fill="#9aa6b6">从 DSH 会话与账本到受保护的 HTTP API 和 Dashboard Client</text>
15
+ <g>
16
+ <rect x="55" y="180" width="320" height="740" rx="22" fill="#151a21" stroke="#8b95a5" stroke-width="2"/>
17
+ <text x="77" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#9aa6b6">DSH 输入</text></g>
18
+ <g>
19
+ <rect x="410" y="180" width="680" height="740" rx="22" fill="#101c19" stroke="#3fae86" stroke-width="2"/>
20
+ <text x="432" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#9aa6b6">Host 服务</text></g>
21
+ <g>
22
+ <rect x="1125" y="180" width="420" height="740" rx="22" fill="#17141f" stroke="#9b74dd" stroke-width="2"/>
23
+ <text x="1147" y="216" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="17" font-weight="650" fill="#9aa6b6">持久化、API 与界面</text></g>
24
+ <path d="M350 420 H400 V390 H475" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
25
+ <path d="M720 390 H790" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
26
+ <path d="M1035 390 H1170" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
27
+ <path d="M912 465 V660" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
28
+ <path d="M350 790 H475" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
29
+ <path d="M720 735 H790" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
30
+ <path d="M1035 735 H1100 V575 H1170" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
31
+ <path d="M1340 425 V510" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
32
+ <path d="M1340 662 V740" fill="none" stroke="#7f8a9a" stroke-width="2.5" marker-start="url(#arch-zh-arrow)" marker-end="url(#arch-zh-arrow)"/>
33
+ <path d="M597 810 V858 H1145 V620 H1170" fill="none" stroke="#7f8a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arch-zh-arrow)"/>
34
+ <g>
35
+ <rect x="85" y="305" width="260" height="230" rx="18" fill="#232a34" stroke="#8b95a5" stroke-width="2.5"/>
36
+ <rect x="99" y="319" width="5" height="202" rx="2.5" fill="#8b95a5" opacity=".42"/>
37
+ <text x="215" y="392" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="215">会话数据</tspan><tspan x="215" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">持久化历史日志</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">实时 session/event</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">注册工作区 registry</tspan></text></g>
38
+ <g>
39
+ <rect x="85" y="715" width="260" height="150" rx="18" fill="#232a34" stroke="#8b95a5" stroke-width="2.5"/>
40
+ <rect x="99" y="729" width="5" height="122" rx="2.5" fill="#8b95a5" opacity=".42"/>
41
+ <text x="215" y="773.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="215">定价与密钥</tspan><tspan x="215" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">models.dev / 手动价格</tspan><tspan x="215" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">DSH DeepSeek 密钥</tspan></text></g>
42
+ <g>
43
+ <rect x="475" y="315" width="245" height="150" rx="18" fill="#12302a" stroke="#3fae86" stroke-width="2.5"/>
44
+ <rect x="489" y="329" width="5" height="122" rx="2.5" fill="#3fae86" opacity=".42"/>
45
+ <text x="597.5" y="373.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="597.5">历史 / 实时同步</tspan><tspan x="597.5" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">扫描变化会话</tspan><tspan x="597.5" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">折叠实时事件</tspan></text></g>
46
+ <g>
47
+ <rect x="790" y="315" width="245" height="150" rx="18" fill="#12302a" stroke="#3fae86" stroke-width="2.5"/>
48
+ <rect x="804" y="329" width="5" height="122" rx="2.5" fill="#3fae86" opacity=".42"/>
49
+ <text x="912.5" y="373.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="912.5">用量归一化</tspan><tspan x="912.5" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">turn/step 去重与替换</tspan><tspan x="912.5" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">解析模型身份与 Token 桶</tspan></text></g>
50
+ <g>
51
+ <rect x="475" y="660" width="245" height="150" rx="18" fill="#12302a" stroke="#3fae86" stroke-width="2.5"/>
52
+ <rect x="489" y="674" width="5" height="122" rx="2.5" fill="#3fae86" opacity=".42"/>
53
+ <text x="597.5" y="718.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="597.5">定价 / 余额</tspan><tspan x="597.5" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">四桶成本估算</tspan><tspan x="597.5" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">账户余额查询</tspan></text></g>
54
+ <g>
55
+ <rect x="790" y="660" width="245" height="150" rx="18" fill="#12302a" stroke="#3fae86" stroke-width="2.5"/>
56
+ <rect x="804" y="674" width="5" height="122" rx="2.5" fill="#3fae86" opacity=".42"/>
57
+ <text x="912.5" y="718.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="912.5">范围聚合</tspan><tspan x="912.5" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">summary · trend · heatmap</tspan><tspan x="912.5" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">daily/hourly · 分页明细</tspan></text></g>
58
+ <g>
59
+ <rect x="1170" y="275" width="340" height="150" rx="18" fill="#241d3a" stroke="#9b74dd" stroke-width="2.5"/>
60
+ <rect x="1184" y="289" width="5" height="122" rx="2.5" fill="#9b74dd" opacity=".42"/>
61
+ <text x="1340" y="333.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="1340">逐会话账本</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">每个 session 独立文档</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">请求明细按需分页读取</tspan></text></g>
62
+ <g>
63
+ <rect x="1170" y="510" width="340" height="152" rx="18" fill="#3a2317" stroke="#e88a5f" stroke-width="2.5"/>
64
+ <rect x="1184" y="524" width="5" height="124" rx="2.5" fill="#e88a5f" opacity=".42"/>
65
+ <text x="1340" y="558.5" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="1340">Host HTTP API</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">仅限 loopback 访问</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">查询限定工作区与模型</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">写入使用进程级令牌</tspan></text></g>
66
+ <g>
67
+ <rect x="1170" y="740" width="340" height="145" rx="18" fill="#0f2c35" stroke="#47b0c9" stroke-width="2.5"/>
68
+ <rect x="1184" y="754" width="5" height="117" rx="2.5" fill="#47b0c9" opacity=".42"/>
69
+ <text x="1340" y="796" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="18" font-weight="700" fill="#eef2f7"><tspan x="1340">Dashboard Client</tspan><tspan x="1340" dy="25" font-size="14" font-weight="450" fill="#b9c3d1">筛选 · 图表 · 请求日志</tspan><tspan x="1340" dy="22" font-size="14" font-weight="450" fill="#b9c3d1">CSV 导出</tspan></text></g>
70
+ <g>
71
+ <rect x="724" y="345" width="62" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
72
+ <text x="755" y="365" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">usage</text></g>
73
+ <g>
74
+ <rect x="914" y="545" width="76" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
75
+ <text x="952" y="565" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">聚合查询</text></g>
76
+ <g>
77
+ <rect x="724" y="690" width="62" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
78
+ <text x="755" y="710" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">费率</text></g>
79
+ <g>
80
+ <rect x="1359" y="451" width="76" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
81
+ <text x="1397" y="471" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">分页明细</text></g>
82
+ <g>
83
+ <rect x="1360" y="674" width="150" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
84
+ <text x="1435" y="694" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">请求 / 结果</text></g>
85
+ <g>
86
+ <rect x="770" y="833" width="200" height="30" rx="15" fill="#1c2129" stroke="#333a45" stroke-width="1.4"/>
87
+ <text x="870" y="853" text-anchor="middle" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="13" fill="#a3adbb">定价 / 余额</text></g>
88
+ <rect x="480" y="943" width="22" height="18" rx="5" fill="#232a34" stroke="#8b95a5" stroke-width="2"/>
89
+ <text x="512" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#a3adbb">DSH 输入</text>
90
+ <rect x="690" y="943" width="22" height="18" rx="5" fill="#12302a" stroke="#3fae86" stroke-width="2"/>
91
+ <text x="722" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#a3adbb">Host 处理</text>
92
+ <rect x="930" y="943" width="22" height="18" rx="5" fill="#241d3a" stroke="#9b74dd" stroke-width="2"/>
93
+ <text x="962" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#a3adbb">持久化</text>
94
+ <rect x="1150" y="943" width="22" height="18" rx="5" fill="#3a2317" stroke="#e88a5f" stroke-width="2"/>
95
+ <text x="1182" y="958" font-family="Inter,system-ui,'Microsoft YaHei',sans-serif" font-size="14" fill="#a3adbb">API / 界面</text></svg>