@shi-yangyang/dsh-token-dashboard 0.1.0 → 0.2.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/README.en.md CHANGED
@@ -34,7 +34,7 @@ DSH already shows token usage for the session in front of you. It does not show
34
34
 
35
35
  `@shi-yangyang/dsh-token-dashboard` adds that missing layer as a native plugin, displayed as **Token usage** in DSH.
36
36
 
37
- The Host half reads session logs through the official `sessionPersistence` service and folds them with the same four-bucket accounting used by `@deepseek-ai/dsh-token-meter`. The Client half registers a `main` panel and a sidebar-footer entry using DSH slots, then renders with the host React runtime and theme tokens.
37
+ The Host half reads session logs through the official `sessionPersistence` service and folds them with the same four-bucket accounting used by `@deepseek-ai/dsh-token-meter`. The Client half registers a `main` panel and a sidebar-footer entry using DSH slots, then renders with the host React runtime and theme tokens. Interactive controls are built on **beUI** (Tailwind CSS + Motion).
38
38
 
39
39
  The plugin never writes a session log, changes a model request, or uploads session data. The logs remain the only source of truth.
40
40
 
@@ -107,7 +107,7 @@ flowchart LR
107
107
  ```
108
108
 
109
109
  - **Host** (`src/host`) reads the official session store, folds usage incrementally, handles pricing, and serves the dashboard API. The cache is in memory and keyed by session revision (or live sequence); there is no second database or ledger.
110
- - **Client** (`src/client`) registers `main` and `sidebar.footer.action` slots, manages scan/language/price preferences, and renders the dashboard. React is supplied by the host and is not bundled twice.
110
+ - **Client** (`src/client`) registers `main` and `sidebar.footer.action` slots, manages scan/language/price preferences, and renders the dashboard. React is supplied by the host and is not bundled twice; BeUI component source lives in `src/client/beui/`, with Tailwind CSS injected at build time.
111
111
  - **Shared** (`src/shared`) contains the wire types, four-bucket arithmetic, range selection, pricing, and formatting used by both sides.
112
112
 
113
113
  Usage follows the published `tokenUsage` semantics: four disjoint provider buckets, final samples replacing stream samples for the same attempt, retries opening a new attempt, and inherited fork prefixes excluded from totals. See [`src/host/fold.ts`](./src/host/fold.ts) for the implementation.
@@ -128,7 +128,7 @@ All routes use the Host Connection gate when available and return `Cache-Control
128
128
 
129
129
  ```bash
130
130
  pnpm install
131
- pnpm build # Host (tsc) + Client (esbuild)
131
+ pnpm build # Host (tsc) + Client (Tailwind + esbuild)
132
132
  pnpm typecheck # Host, Client, and Test type checks
133
133
  pnpm test # 87 tests: unit, routes, SSR, jsdom, bundle
134
134
  pnpm verify:real # fold real local logs against an independent reference
@@ -139,7 +139,7 @@ pnpm build:prices # refresh the generated OpenRouter price snapshot (network)
139
139
 
140
140
  ```text
141
141
  src/host session source, token fold, aggregation, prices, HTTP routes
142
- src/client React UI, DSH slots, hooks, theme-token styles
142
+ src/client React UI, DSH slots, hooks, BeUI controls, theme-token styles
143
143
  src/shared wire types, pricing, ranges, formatting
144
144
  test node:test suites plus SSR/jsdom rendering checks
145
145
  scripts build, test, and real-session verification
@@ -161,4 +161,6 @@ Issues and pull requests are welcome. Run `pnpm typecheck` and `pnpm test` befor
161
161
 
162
162
  [MIT](./LICENSE) © 2026 小洋
163
163
 
164
+ UI controls are based on [beUI](https://github.com/starc007/ui-components) (MIT). See [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md).
165
+
164
166
  Built for DeepSeek Harness and Cordis. Pricing data comes from the public OpenRouter model list and DeepSeek's published rates.
package/README.md CHANGED
@@ -34,7 +34,7 @@ DSH 已经能显示当前会话的 Token 用量,但看不到完整视图:所
34
34
 
35
35
  `@shi-yangyang/dsh-token-dashboard` 补上的就是这一层,以 **Token 用量** 的形式作为原生插件运行。
36
36
 
37
- Host 端通过官方 `sessionPersistence` 服务读取会话日志,并使用与 `@deepseek-ai/dsh-token-meter` 一致的四桶口径折叠数据。Client 端通过 DSH Slot 注册 `main` 面板和侧边栏 footer 入口,使用宿主提供的 React 运行时和主题 Token 渲染。
37
+ Host 端通过官方 `sessionPersistence` 服务读取会话日志,并使用与 `@deepseek-ai/dsh-token-meter` 一致的四桶口径折叠数据。Client 端通过 DSH Slot 注册 `main` 面板和侧边栏 footer 入口,使用宿主提供的 React 运行时和主题 Token 渲染。交互控件基于 **beUI**(Tailwind CSS + Motion)构建。
38
38
 
39
39
  插件不会写入会话日志、修改模型请求或上传会话数据。会话日志始终是唯一事实来源。
40
40
 
@@ -107,7 +107,7 @@ flowchart LR
107
107
  ```
108
108
 
109
109
  - **Host**(`src/host`)读取官方会话存储、增量折叠用量、处理价目并提供看板 API。缓存只在内存中,按会话 revision 或 live sequence 维护;没有第二个数据库或账本。
110
- - **Client**(`src/client`)注册 `main` 与 `sidebar.footer.action` Slot,管理扫描间隔、语言和价目偏好,并渲染看板。React 由宿主提供,不会重复打包。
110
+ - **Client**(`src/client`)注册 `main` 与 `sidebar.footer.action` Slot,管理扫描间隔、语言和价目偏好,并渲染看板。React 由宿主提供,不会重复打包;BeUI 控件源码在 `src/client/beui/`,Tailwind 样式在构建时注入。
111
111
  - **Shared**(`src/shared`)包含双方共用的 wire 类型、四桶运算、范围选择、价目和格式化。
112
112
 
113
113
  统计遵循 `tokenUsage` 的公开口径:四个互斥 provider 桶、同一次 attempt 的最终样本替换流式样本、重试开启新 attempt、分叉继承的前缀不计入总量。实现见 [`src/host/fold.ts`](./src/host/fold.ts)。
@@ -128,7 +128,7 @@ HTTP 接口只读且同源:
128
128
 
129
129
  ```bash
130
130
  pnpm install
131
- pnpm build # Host(tsc)+ Client(esbuild)
131
+ pnpm build # Host(tsc)+ Client(Tailwind + esbuild)
132
132
  pnpm typecheck # Host、Client、Test 三套类型检查
133
133
  pnpm test # 87 个测试:单元、路由、SSR、jsdom、bundle
134
134
  pnpm verify:real # 用独立实现校验真实本地日志折叠
@@ -139,7 +139,7 @@ pnpm build:prices # 刷新 OpenRouter 内置价目快照(需要网络)
139
139
 
140
140
  ```text
141
141
  src/host 会话源、Token fold、聚合、价目、HTTP 路由
142
- src/client React 界面、DSH Slot、hooks、主题 Token 样式
142
+ src/client React 界面、DSH Slot、hooks、BeUI 控件、主题 Token 样式
143
143
  src/shared wire 类型、价目、范围、格式化
144
144
  test node:test 测试与 SSR/jsdom 渲染检查
145
145
  scripts 构建、测试、真实会话校验
@@ -161,4 +161,6 @@ scripts 构建、测试、真实会话校验
161
161
 
162
162
  [MIT](./LICENSE) © 2026 小洋
163
163
 
164
+ 界面控件基于 [beUI](https://github.com/starc007/ui-components)(MIT);第三方声明见 [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md)。
165
+
164
166
  为 DeepSeek Harness 与 Cordis 构建。价目数据来自公开的 OpenRouter 模型列表和 DeepSeek 公布的单价。
@@ -0,0 +1,25 @@
1
+ # Third-party notices
2
+
3
+ ## beUI
4
+
5
+ This project vendors and adapts components from **beUI** for its dashboard
6
+ controls. The vendored source lives under `src/client/beui/`.
7
+
8
+ - Upstream: https://github.com/starc007/ui-components
9
+ - Website: https://beui.dev
10
+ - License: MIT
11
+
12
+ The upstream MIT license is reproduced in `src/client/beui/LICENSE`.
13
+
14
+ ## Runtime dependencies
15
+
16
+ The bundled browser client also contains code from these MIT/ISC-licensed
17
+ packages, installed from npm:
18
+
19
+ - **Motion** — https://github.com/motiondivision/motion — MIT
20
+ - **Lucide** — https://github.com/lucide-icons/lucide — ISC
21
+ - **clsx** — https://github.com/lukeed/clsx — MIT
22
+ - **tailwind-merge** — https://github.com/dcastil/tailwind-merge — MIT
23
+ - **Tailwind CSS** utilities — https://github.com/tailwindlabs/tailwindcss — MIT
24
+
25
+ Their full license texts are distributed with the corresponding npm packages.