dsh-all-usage 1.1.10 → 1.1.13
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/CHANGELOG.md +34 -0
- package/README.md +30 -20
- package/lib/aggregation.js +1 -1
- package/lib/client.js +1 -1
- package/lib/http.js +32 -0
- package/lib/plugin.js +3 -0
- package/package.json +3 -3
package/lib/http.js
CHANGED
|
@@ -249,6 +249,38 @@ export function registerRoutes(host) {
|
|
|
249
249
|
sendJson(res, 200, statusSnapshot())
|
|
250
250
|
},
|
|
251
251
|
}))
|
|
252
|
+
ctx.effect(() => webServer.register({
|
|
253
|
+
kind: 'exact',
|
|
254
|
+
path: '/api/all-usage/client-env',
|
|
255
|
+
handler: (req, res) => {
|
|
256
|
+
if (req.method !== 'GET') { res.statusCode = 405; res.end(); return }
|
|
257
|
+
if (!isTrustedLocalApiRequest(req, false)) { rejectRequest(res); return }
|
|
258
|
+
// Diagnostics only: the client reports what the host exposes (user agent,
|
|
259
|
+
// window-controls-overlay geometry, the strip it reserved). Truncated and
|
|
260
|
+
// kept in memory for the life of the process.
|
|
261
|
+
try {
|
|
262
|
+
const url = new URL(req.url ?? '/', 'http://x')
|
|
263
|
+
const read = (name, limit) => {
|
|
264
|
+
const value = url.searchParams.get(name)
|
|
265
|
+
return value === null ? null : value.slice(0, limit)
|
|
266
|
+
}
|
|
267
|
+
state.clientEnv = {
|
|
268
|
+
reportedAt: Date.now(),
|
|
269
|
+
ua: read('ua', 200),
|
|
270
|
+
wco: read('wco', 40),
|
|
271
|
+
inset: read('inset', 12),
|
|
272
|
+
insetSource: read('src', 24),
|
|
273
|
+
titlebar: read('tb', 24),
|
|
274
|
+
viewport: read('vp', 24),
|
|
275
|
+
modalRect: read('modal', 40),
|
|
276
|
+
dialogRect: read('dlg', 40),
|
|
277
|
+
headRect: read('head', 40),
|
|
278
|
+
closeRect: read('close', 40),
|
|
279
|
+
}
|
|
280
|
+
} catch (err) { /* ignore a malformed diagnostic */ }
|
|
281
|
+
sendJson(res, 200, { ok: true })
|
|
282
|
+
},
|
|
283
|
+
}))
|
|
252
284
|
ctx.effect(() => webServer.register({
|
|
253
285
|
kind: 'exact',
|
|
254
286
|
path: '/api/all-usage',
|
package/lib/plugin.js
CHANGED
|
@@ -24,6 +24,9 @@ function apply(ctx) {
|
|
|
24
24
|
// shared "deleted" bucket; the bucket row is only advertised when it holds
|
|
25
25
|
// something.
|
|
26
26
|
retiredBucketUsed: false,
|
|
27
|
+
// Last client-side environment report (diagnostics only): the desktop host
|
|
28
|
+
// cannot be inspected from outside the app.
|
|
29
|
+
clientEnv: null,
|
|
27
30
|
pathIndex: new Map(),
|
|
28
31
|
memberOf: new Map(),
|
|
29
32
|
byDay: new Map(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-all-usage",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"description": "DeepSeek Harness usage dashboard with model, provider, workspace, cache, balance, and CSV insights",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dsh": {
|
|
33
33
|
"compatibility": {
|
|
34
|
-
"runtime": ">=0.1.1-rc.1 <0.1.5-0 || >=0.1.5-rc.1 <0.1.6-0",
|
|
35
|
-
"verified": ["0.1.5-rc.1", "0.1.1-rc.2", "0.1.1-rc.1"]
|
|
34
|
+
"runtime": ">=0.1.1-rc.1 <0.1.5-0 || >=0.1.5-rc.1 <0.1.6-0 || >=0.1.7-rc.2 <0.1.8-0",
|
|
35
|
+
"verified": ["0.1.7-rc.2", "0.1.5-rc.2", "0.1.5-rc.1", "0.1.1-rc.2", "0.1.1-rc.1"]
|
|
36
36
|
},
|
|
37
37
|
"bundle": {
|
|
38
38
|
"patch": "./cordis.patch.yml"
|