nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Billwu18/dsh-cache-hit-monitor
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Live prompt-cache telemetry for the current session, drawn as an instrument panel in the DSH right sidebar.
English · 中文说明

The plugin adds one tab to the DSH right sidebar. It reads the tokenUsage and
contextPressure session projections the Host already publishes and shows them
as four flat instrument faces:
| Face | Shows |
|---|---|
| Hit rate | Session cache-hit rate as a 5×7 dot-matrix percentage, plus the settled request count, the last request's rate, that request's age and a 28-lamp bar against the current prompt total. |
| Register bank | The four disjoint cache buckets — cache read, cache write, uncached input, output — with session totals and proportional lamp rows. |
| Reactor core | One cell per settled request, newest first. Ink is that request's cache-hit rate, diameter is its size against the heaviest request on the board, and the field fades with age. |
| Context pressure | Pressure tokens against the context window. |
The tab opens by itself once per page load, so the panel is on screen without hunting through the tab guide. It closes like any other tab.
hit rate = cache read / (cache read + cache write + uncached input)
Output tokens are deliberately excluded. Generated tokens are never cacheable, so counting them would flatter the number — a long generation would make a cold prompt look warm.
One cell is one request that settled while the panel was mounted, ordered newest-first from the top left. The board is one whole number of rows at all times, and it is never taller than the history it actually holds, so a young session shows a short row rather than a large empty lattice.
sqrt(request tokens / heaviest request on the board), which
keeps small requests visible next to a cold burst.Each cell carries a title with its exact read / write / uncached / output
split, so the picture can be audited rather than trusted.
dsh plugin --profile web add github:Billwu18/dsh-cache-hit-monitor
Or install it through the Plugin Manager in the Web UI.
git clone https://github.com/Billwu18/dsh-cache-hit-monitor
dsh plugin --profile web add /absolute/path/to/dsh-cache-hit-monitor
Then reload the page. The Host re-reads plugin artifacts by modification time,
so edits to client.js are picked up by a refresh — no dsh web restart.
>=0.1.7-rc.1 <0.2.0-0>=20 (only for the test harnesses; the plugin itself runs in the browser)No dependencies, no build step, no install scripts.
The Host half is deliberately inert (index.js exports an empty apply). It
exists so the bundle has a Loader row and can be enabled, disabled and inspected
like any other plugin.
Everything the panel shows is already computed on the Host:
@deepseek-ai/dsh-token-meter
folds the durable session log into the tokenUsage and contextPressure
projections. The Client half reads them from its slot props via useProjection
and renders.
The client bundle is a single file (client.js) in the DSH browser-module
format. It uses only React and standard browser APIs:
getComputedStyle plus a ResizeObserver, and re-renders once before paint.
If the measurement is unavailable the board simply grows with the data instead
of being capped.keepMounted: true, which prevents that remount in the first place.The panel reads local session projections. It makes no network requests, sends no telemetry, and stores nothing outside the browser tab. Clearing history touches only in-memory state.
| DSH | >=0.1.7-rc.1 <0.2.0-0 |
| Platform | web (dsh.client.platform) |
| React | 18 or newer (provided by the host) |
| Themes | Both. The instrument faces are intentionally dark in both themes; the surrounding chrome follows the --dsw-* theme tokens. |
| Locales | English and Chinese. Other locales fall back to English. |
| Hosts | Any host that provides the sidebarRightTabs service. |
No dependencies are required to work on this plugin — the tests run on plain
Node against the real client.js.
node test/run-all.mjs # all four suites
node test/preview.mjs # writes HTML that can be screenshotted
dsh-cache-hit-monitor/
├── client.js the entire browser half (React, DSH module format)
├── index.js the host half (intentionally inert)
├── cordis.patch.yml the Loader row that installs the plugin
├── package.json manifest: dsh.bundle + dsh.client
├── icon.svg plugin card artwork
├── screenshots.json storefront screenshots, relative to this file
├── locale/
│ ├── en.json plugin card title and description
│ └── zh.json
├── assets/ screenshots referenced by the READMEs
└── test/
├── run-all.mjs runs every suite below
├── preview.mjs renders the panel to standalone HTML
├── wiring.test.mjs bundle identity, effects, tab and slot registration
├── render.test.mjs the rendered tree: shapes, counts, no NaN, key coverage
├── persist.test.mjs history and depth survive a remount
└── robust.test.mjs adversarial inputs and locale coverage
There is no DOM and no test framework. Each harness stubs
window.__ModuleLoader__ to capture the bundle, stubs react, applies the real
apply(ctx) against a stub context, then drives the registered component with a
small renderer.
That is enough to assert real behaviour: which services the plugin injects, what
it registers into which slot, how many cells and lamps the tree contains, that
history survives a remount, and that no reachable input produces a thrown
exception or leaks undefined/NaN into a style string.
| Suite | Asserts |
|---|---|
wiring |
Module id, declared injects, ctx.effect registrations, the tab definition (including keepMounted), both keyed slot registrations, and that the body is a component. |
render |
Rendered tree shape: dot-matrix dots, reactor cells and cell dots, bar lamps, register rows, exactly one red element, no undefined/NaN in any style, and that every element in an array has a React key. |
persist |
A real per-instance hook runtime: record a request, change the depth, unmount, remount — history, depth and keepMounted all confirmed. |
robust |
16 adversarial scenarios (missing or throwing projection, NaN/Infinity/negative/string token counts, no session id, no translate seat, empty to 10 000 events) must all render, and every locale key must exist in both dictionaries. |
MIT © 2026 Billwu18
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: prompt-cache。