dsh-plugin-system-status 0.0.0-stage → 0.1.1
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.md +84 -2
- package/client.js +1102 -0
- package/cordis.patch.yml +3 -0
- package/docs/DETAIL.md +20 -0
- package/host/gpu.js +134 -0
- package/host/history.js +290 -0
- package/host/routes.js +93 -0
- package/host/sampler.js +139 -0
- package/icon.svg +6 -0
- package/index.js +43 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +55 -4
package/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { homedir } from 'node:os'
|
|
2
|
+
import { join } from 'node:path'
|
|
3
|
+
import { createGpuSource } from './host/gpu.js'
|
|
4
|
+
import { createSampler } from './host/sampler.js'
|
|
5
|
+
import { createHistoryStore } from './host/history.js'
|
|
6
|
+
import { registerRoutes } from './host/routes.js'
|
|
7
|
+
|
|
8
|
+
const SAMPLE_INTERVAL_MS = 3000
|
|
9
|
+
const HISTORY_FLUSH_MS = 5000
|
|
10
|
+
const HISTORY_RETENTION_DAYS = 7
|
|
11
|
+
|
|
12
|
+
/** The routes live on the host web server, so require it instead of degrading. */
|
|
13
|
+
export const inject = ['webServer']
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Start sampling, persist history, and publish both over HTTP. Everything this
|
|
17
|
+
* opens is registered on the plugin's own context, so disabling the plugin
|
|
18
|
+
* releases the timer, the nvidia-smi child, the routes, and every open stream.
|
|
19
|
+
* @param {import('@deepseek-ai/cordis').Context} ctx plugin context
|
|
20
|
+
*/
|
|
21
|
+
export function apply(ctx) {
|
|
22
|
+
const gpu = createGpuSource({ intervalMs: SAMPLE_INTERVAL_MS })
|
|
23
|
+
const sampler = createSampler({ gpu, intervalMs: SAMPLE_INTERVAL_MS })
|
|
24
|
+
const historyDir = join(process.env.DSH_HOME ?? join(homedir(), '.dsh'), 'system-status')
|
|
25
|
+
const history = createHistoryStore({
|
|
26
|
+
dir: historyDir,
|
|
27
|
+
retentionDays: HISTORY_RETENTION_DAYS,
|
|
28
|
+
flushMs: HISTORY_FLUSH_MS,
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
ctx.effect(() => {
|
|
32
|
+
const releaseRoutes = registerRoutes(ctx.webServer, { sampler, history })
|
|
33
|
+
const unsubscribe = sampler.subscribe((sample) => history.push(sample))
|
|
34
|
+
sampler.start()
|
|
35
|
+
return () => {
|
|
36
|
+
unsubscribe()
|
|
37
|
+
releaseRoutes()
|
|
38
|
+
sampler.stop()
|
|
39
|
+
gpu.stop()
|
|
40
|
+
void history.close().catch(() => {})
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
}
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "System status",
|
|
4
|
+
"description": "A live CPU, memory, GPU, VRAM and GPU temperature strip under the composer, plus CPU, memory, VRAM, disk and temperature history charts reached from the left sidebar. History is sampled only while DSH runs.",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-system-status",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Real-time and historical CPU, GPU, memory, disk and temperature status for the machine running DeepSeek Harness.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "chenmohan123",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/chenmohan123/dsh-plugin-system-status.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/chenmohan123/dsh-plugin-system-status#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/chenmohan123/dsh-plugin-system-status/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"dsh-plugin",
|
|
17
|
+
"deepseek-harness",
|
|
18
|
+
"dsh",
|
|
19
|
+
"system-monitor",
|
|
20
|
+
"cpu",
|
|
21
|
+
"gpu",
|
|
22
|
+
"memory",
|
|
23
|
+
"vram",
|
|
24
|
+
"windows"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": "./index.js",
|
|
29
|
+
"./client": "./client.js",
|
|
30
|
+
"./locale/*.json": "./locale/*.json",
|
|
31
|
+
"./icon": "./icon.svg"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"index.js",
|
|
35
|
+
"client.js",
|
|
36
|
+
"cordis.patch.yml",
|
|
37
|
+
"host",
|
|
38
|
+
"locale/*.json",
|
|
39
|
+
"docs/DETAIL.md",
|
|
40
|
+
"icon.svg"
|
|
41
|
+
],
|
|
42
|
+
"dsh": {
|
|
43
|
+
"bundle": {
|
|
44
|
+
"patch": "./cordis.patch.yml"
|
|
45
|
+
},
|
|
46
|
+
"client": {
|
|
47
|
+
"platform": "web",
|
|
48
|
+
"immediately": true,
|
|
49
|
+
"inject": [
|
|
50
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
52
|
+
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
53
|
+
"@deepseek-ai/dsh-client-locale"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|