dsh-usage-dashboard: Serving Usage Reports at /usage on the DeepSeek Harness Host Web
sjtumalpan/dsh-usage-dashboard
Mounts the usage report produced by dsh-usage-stats onto the DSH host web server at /usage, reusing the host login session for auth with zero dependencies.
dsh-usage-dashboard is a DSH plugin that wires the usage report page into the DeepSeek Harness host web server, mounted at /usage by default. It does not generate data; it closes the gap between report generation and report access, leaving the data to the report generator while exposing only the resulting page through the host's web route registration interface, without modifying any other project. Authentication reuses the host login session, so any browser that can open the GUI on the same origin can open the report, with 401 for unauthenticated requests and 403 for failed Host/Origin checks. It is pure ESM with zero dependencies under the MIT license, and re-reads the file from disk on every request, so a refresh is enough after regenerating.
How to Install
dsh plugin --profile web add github:sjtumalpan/dsh-usage-dashboard- Category
- Models & Reasoning
- Platform
- DSH Plugin
- Author
- sjtumalpan
- Distribution
- Plugin
dsh-usage-dashboard Key Features
dsh-usage-dashboard Repo Summary
What Does It Do?
It is a DSH plugin for DeepSeek Harness that serves the HTML usage report produced by dsh-usage-stats at the /usage path of the host web server. It solves the gap between report generation and report access: the report data belongs to dsh-usage-stats, while this plugin only wires the resulting page into the host web server without modifying any other project. The plugin is pure ESM with zero dependencies, maintained by SJTUMalPan under the MIT license, and it reuses the host login session for authentication instead of introducing its own token system.
Core Features
- Route mounting: registers the report page on a configurable absolute path, defaulting to /usage, through the host's web route registration interface.
- Host authentication reuse: calls the host's request validation interface to reuse Host/Origin fencing and session cookies, so any browser that can open the DSH GUI on the same origin can open the report; unauthenticated requests get 401 and failed Host/Origin checks get 403.
- Read-from-disk per request: the report file is re-read on every request, so regenerating the report and refreshing the page is enough, with no need to restart the host web server.
- Well-defined responses: non-GET/HEAD methods return 405 with an Allow header, a missing report file returns 404 without echoing the configured path, and normal responses are text/html with no-store and nosniff headers.
- Load-time config validation: the mount path must be absolute, start with /, not be the root, have no trailing slash, and contain no query string or fragment; invalid values throw at load time instead of failing later with a 404.
- Automatic cleanup: the route is unregistered automatically when the plugin is unloaded, leaving no stale mount point.
How to Use This Plugin?
After enabling it in DSH, log in to the GUI at the same address first, then open /usage directly to view the report without copying any token. The report itself is generated by dsh-usage-stats; point the reportPath config at the generated HTML file, or rely on the default report file inside this package for a zero-config setup. Both the mount path and the report path are optional, and you can adjust path and reportPath in the plugin config when needed. After regenerating the report, just refresh the page to see fresh data, with no restart of the host web server required. Keep in mind that the report contains project names, session ids, and costs, so do not move it onto an unauthenticated host path; the page's availability follows the host web server, so it is unreachable whenever the host is down.
How to Troubleshoot This Plugin?
A 401 on the report page means the browser has not passed host authentication, so log in to the DSH GUI at the same address first. A 403 means the Host/Origin check failed, so verify the address is same-origin with the host. A 405 means the request method is not GET or HEAD, so open the page directly in a browser. A 404 means the report file does not exist, so confirm the file referenced by reportPath has been generated and the path is correct. If the plugin throws during loading, the path config is most likely invalid; follow the official instructions and use an absolute path that starts with /, is not the root, has no trailing slash, and contains no query string or fragment.
This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: sjtumalpan/dsh-usage-dashboard. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.
DSH Plugin FAQ
