dsh-token-use 0.1.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/LICENSE +21 -0
- package/README.en.md +105 -0
- package/README.md +105 -0
- package/client/client.js +428 -0
- package/cordis.patch.yml +7 -0
- package/lib/index.js +727 -0
- package/lib/scan-worker.js +12 -0
- package/package.json +66 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boot-scan worker: rebuilds the usage fold off the host thread so a large
|
|
3
|
+
* session history never blocks the running app. Uses the same UsageTracker as
|
|
4
|
+
* the host (node:zlib per-frame zstd decode), then posts the aggregated fold
|
|
5
|
+
* back; the host merges it and replays any events buffered meanwhile.
|
|
6
|
+
*/
|
|
7
|
+
import { parentPort, workerData } from 'node:worker_threads'
|
|
8
|
+
import { UsageTracker } from './index.js'
|
|
9
|
+
|
|
10
|
+
const tracker = new UsageTracker(workerData.dshHome)
|
|
11
|
+
await tracker.scanSessions({ worker: false })
|
|
12
|
+
parentPort.postMessage(tracker.serialize())
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-token-use",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Real-time token usage dashboard for DeepSeek Harness — live totals (input/output/cache/reasoning), filters by model, day, month and project, and a smooth trend chart. · 实时 Token 用量仪表盘:总量/输入/输出/缓存命中按模型、按天、按月、按项目随选,附趋势曲线。",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"dsh",
|
|
7
|
+
"dsh-plugin",
|
|
8
|
+
"deepseek-harness",
|
|
9
|
+
"token",
|
|
10
|
+
"token-usage",
|
|
11
|
+
"usage-dashboard",
|
|
12
|
+
"echarts"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "huangyuheng",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/huangyuheng/dsh-token-use.git"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/huangyuheng/dsh-token-use#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/huangyuheng/dsh-token-use/issues"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "lib/index.js",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./lib/index.js",
|
|
28
|
+
"./client": "./client/client.js",
|
|
29
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"lib",
|
|
34
|
+
"client/client.js",
|
|
35
|
+
"cordis.patch.yml"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=22.19"
|
|
39
|
+
},
|
|
40
|
+
"dsh": {
|
|
41
|
+
"bundle": {
|
|
42
|
+
"patch": "./cordis.patch.yml"
|
|
43
|
+
},
|
|
44
|
+
"client": {
|
|
45
|
+
"platform": "web",
|
|
46
|
+
"inject": [
|
|
47
|
+
"@deepseek-ai/dsh-client-connection",
|
|
48
|
+
"@deepseek-ai/dsh-client-locale",
|
|
49
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "node scripts/build-client.mjs"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"echarts": "^6.1.0",
|
|
64
|
+
"esbuild": "^0.28.2"
|
|
65
|
+
}
|
|
66
|
+
}
|