dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DeepSeek Harness 插件资源开销面板:按插件归因 CPU / 内存 / 磁盘占用。A DSH plugin panel showing which plugins use the host CPU, memory and disk, attributed per plugin.
A DeepSeek Harness (DSH) plugin that shows which plugin is using your host's CPU, memory and disk — and which plugin is making the browser jank.
Every DSH host plugin runs in one Node process, so the operating system can only tell you what the whole process costs. Perf Lens samples that process from the inside, charges each sample to the plugin that caused it, and puts the result in a dashboard in the DSH web GUI — with the same treatment on the browser side, where long-frame script time is attributed per plugin (Long Animation Frames API). No more throwaway profiling scripts when something feels slow.
Status: 0.1.0 feature-complete (see CHANGELOG.md); 0.2.0 is in progress on
master— per-plugin jank attribution, the descendant-process view, and the listeners / on-disk columns have already landed.
Open Perf Lens in the left sidebar:
$DSH_HOME) per plugin.The panel follows the GUI language (Chinese or English).
dsh web)Not on npm yet — install from a local checkout:
git clone https://github.com/Nwflower/dsh-perf-lens.git
cd dsh-perf-lens && pnpm install && pnpm build # produces lib/ (host + single-file client bundle)
Then register it in your DSH profile. For the default web profile, edit
~/.dsh/profiles/web/package.json:
{
"dsh": { "profile": { "bundles": [ /* … existing bundles … */, "dsh-perf-lens" ] } },
"dependencies": { "dsh-perf-lens": "link:D:/path/to/dsh-perf-lens" }
}
cd ~/.dsh/profiles/web && pnpm install
The host half loads when the server starts, so restart dsh web for it to take effect. Once the
package is published to npm, the dependency line becomes "dsh-perf-lens": "^0.1.0" and no build
step is needed. If the profile's pnpm supply-chain policy (minimumReleaseAge) blocks a package,
run a one-off pnpm install --config.minimumReleaseAge=0 instead of changing the profile's
settings.
Sampling is never free, so Perf Lens samples in short windows and lets you choose how hard it looks. There are three controls, and they combine — the panel always shows the combination it is actually running, not just which buttons are lit.
Intensity (one of three):
| Tier | What it does | When to use it |
|---|---|---|
| Low (default) | A 5-second window every 30 seconds or more; backs off to 2 minutes when the host is idle, with a cheap 1-second check every 10 seconds so bursts are not missed | Always on |
| High | Back-to-back 2-second windows; drops back to low after 10 minutes | While you are actively watching something |
| Stop | No new windows | When you want the host left alone |
Background sampling (on / off) decides what happens while the intensity is Stop: on, the host keeps a coarse 2-second window every 2 minutes, so a long-term record survives with the panel closed. It has nothing to add at Low or High, where the foreground already samples.
Memory sampling (on / off) adds heap sampling to whichever windows run — memory attribution, hot functions per plugin, and credit for work a plugin schedules through harness callbacks. It is the most expensive option, and the only one that costs extra on top of CPU sampling.
So Stop + background on is a cheap always-on record, Low + memory on is the normal profiling setup, and High + memory on is "I am watching this right now". Every change takes effect immediately, and all three settings are reported by the host, so they survive a page reload.
$DSH_HOME plus each plugin's own directory);
file bytes read and written are not. The scan does not follow symbolic links, so a plugin whose
files sit behind a link outside both of those roots reads as empty.async_hooks hook, which measured 2.3–2.6× on promise-heavy work, so the panel reports the
process totals and leaves the per-plugin columns out rather than showing a false zero. Listeners
are per plugin and exact.dsh-app:// custom
scheme) withholds script attribution at the browser level, so the long-frame table only appears on
the dsh web GUI.$DSH_HOME/perf-lens/metrics-YYYYMMDD.jsonl (default ~/.dsh/perf-lens/). Files are kept for
14 days, capped at 200 MB in total.$DSH_HOME but writes only the resulting byte totals, and the descendant-process reading
keeps process names in memory only.ps, or PowerShell on Windows) every
30 seconds; that is the only external process Perf Lens starts.If the panel is empty or the numbers look wrong, check the diagnostics endpoint first:
Invoke-RestMethod http://127.0.0.1:3081/api-perf/diagnostics | ConvertTo-Json -Depth 4
sampleCount of 0 means the last window collected no samples; lastError shows the exception the
sampling loop caught.ownerRules should list real package directories (for example …/node_modules/dsh-context/lib). If
it is empty or points at the profile directory, plugin paths could not be resolved and samples will
land in "unattributed".listenersMeasured should be true. If it is false the cordis event registry was not exposed, so
the Listeners column is a gap rather than a number.processTree.available should be true with a non-zero at. If it is false, the process-table
command (ps, or PowerShell on Windows) is missing or was denied, and the overview says "unreadable"
rather than "no children" — those are different facts.diskFootprint should be non-null with a recent scannedAt. truncated: true means the walk hit
its budget or could not open a root, so every on-disk figure is a lower bound.dsh web
starts; the panel is a bundle the page fetches. After upgrading the plugin the page can be newer
than the running host, and a host that predates the three-block controls does not know the fields
they send — a click would be silently ignored. The panel detects this (the host reports no sampling
config) and disables the controls instead. Restart dsh web to pick up the new host half./api-perf/snapshot from a host older than 0.1.0 has no
sampling field, and /api-perf/trend from one older than the absolute basis has no cpuMsPerSec.The HTTP API behind the panel (/api-perf/snapshot, /stats, /trend, /hotspots, …) is
documented in docs/design.md §8.
pnpm install # dev toolchain only; the harness peer packages are not installed (see .npmrc)
pnpm test # vitest: host specs in node, client specs in jsdom
pnpm typecheck # tsc --noEmit
pnpm lint # oxlint
pnpm build # tsdown: lib/index.js (host) + lib/client.js (single-file client bundle)
prepublishOnly runs all four.
After local changes, rebuild with pnpm build, then reload the page to pick up client changes;
host changes need a restart of dsh web.
The harness client type packages are not installed as dev dependencies: their registry latest tag
points at a broken 0.0.1-rc.1 line that depends on an unpublished package. The client declares the
structural types it needs in src/client/ctx.ts instead, as dsh-context does.
| Document | Contents |
|---|---|
| docs/feasibility.md | Why this works: runtime facts, each mechanism verified, overhead, limits |
| docs/landscape-survey.md | Who else attributes runtime cost to a plugin: the DSH ecosystem, other plugin hosts, continuous profilers, and what to borrow |
| docs/roadmap-proposals.md | Proposed features after the survey, ordered by which promise gaps are real |
| docs/design.md | Architecture: attribution, metric contract, sampling state machine, persistence, HTTP API, dashboard layout, decisions |
| docs/evidence.md | Raw measured output behind every conclusion, and how to reproduce it |
| docs/design-overnight-analyzer.md | Research on continuous background analysis: sampler cost, heap snapshots (rejected), share vs absolute cost, detection precision |
| probes/README.md | The one-off research scripts and what each one established |
| CHANGELOG.md | What each release contains |
More DSH plugins by the same author: dsh-chat-import (migrate 25+ external agents' chat history into DSH) · dsh-pilot (contract-driven master/subagent dispatch) · dsh-file-claim (multi-session file claiming) · dsh-claude-style