Passer au contenu principal
R

dsh-pulse-rail

rinsoraa/dsh-pulse-rail

Transforme la barre de navigation entre tours DSH en visualiseur musical : chaque barre fine grandit et s’épaissit selon sa bande de fréquence, à partir du son système capturé par WASAPI loopback. Géométrie uniquement, sans couleur ni halo ; l’aperçu au survol, le saut au clic et le défilement à la molette restent disponibles.

Installer

dsh plugin --profile web add github:rinsoraa/dsh-pulse-rail

README

dsh-pulse-rail

English | 中文

Turn the DeepSeek Harness turn-navigation rail into a music visualiser: every thin bar grows and thickens with the system audio that is playing right now.

rail

  • Windows, no admin, no drivers, no third-party runtime. System audio is captured with WASAPI shared-mode loopback by a tiny self-contained helper (lib/pulse-tap.exe, built from lib/pulse-tap.cs with the in-box .NET Framework compiler).
  • Nothing but the bars change. Bar length tracks its frequency band; bar thickness follows the beat. No glow, no colour, no shadow — pure geometry, and the whole thing is a compositor-only transform: scale(), so the right edge never jitters.
  • Native behaviour is untouched. Hover previews, click-to-jump and wheel scrolling of the rail keep working exactly as before; with silence the bars return pixel-for-pixel to the stock look.
  • Two settings entry points, neither one covers the app. A compact popover from the account menu and a full page in DSH Settings, sharing one implementation.

Requirements

DSHdesktop / web profile (platform: web client half)
OSWindows 10/11 x64 (WASAPI loopback)
Runtimenone — .NET Framework 4.x csc is used only to build the helper
Audioany default render device (headphones, USB DAC, HDMI, …)

Install

  1. Settings → Plugins → Add plugin and give this repository's URL (or a local path to a clone).
  2. Enable it, then restart DSH (the host half is composed at boot).

The manager refuses to install while an agent is running — do it from an idle session.

B. From npm

Published as dsh-pulse-rail:

dsh plugin add dsh-pulse-rail      # or: npm i dsh-pulse-rail

C. Manual

git clone https://github.com/rinsoraa/dsh-pulse-rail.git
xcopy /E /I dsh-pulse-rail "%USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-pulse-rail"

Then add "dsh-pulse-rail" to dsh.profile.bundles in %USERPROFILE%\.dsh\profiles\desktop\package.json:

{
  "dsh": { "profile": { "bundles": [
    "@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-pulse-rail"
  ] } }
}

and restart DSH. (Adding the package to dependencies as well makes it show up in the installed-plugin list and protects it from pnpm install pruning.)

Where the settings live

Two entry points, both since 0.5.0. The floating ♪ button is gone.

WhereHowWhat you get
Bottom-left account popupClick the bottom-left user row, then the pulse-rail row (「律动设置」 / Pulse rail settings) in the 设置 / 意见反馈 / 退出登录 listA 300 px popover pinned to the bottom-left corner, at most min(58vh, 440px) tall — the rail on the right edge stays fully visible, so you can drag a slider and watch the bars react
DSH SettingsSettings → the pulse-rail page in the left nav (♪ icon)A full settings page with the same controls

Both entry points share one control implementation, so values, live write-back and light/dark adaptation are identical, and editing in one place updates the other immediately.

UI language follows DSH's locale: Simplified and Traditional Chinese get the Chinese panel; every other language gets the English one. Labels — including the account-menu row and the Settings page name — are rewritten in place, no restart.

The account popup is shell-rendered and has no extension slot, so the plugin injects its row by cloning the native 设置 / Settings item (colours, font, radius and icon come from the app, the icon glyph is ♪). If a future DSH redesign changes that menu, the row can fail to appear — the visualiser itself is unaffected.

Tuning

Everything lives in %USERPROFILE%\.dsh\pulse-rail\config.json. Edit it from the settings UI, or by hand — then apply with the bundled helper:

%USERPROFILE%\.dsh\pulse-rail\tune-config.cmd
{
  "enabled": true,      // false = stop immediately, rail returns to stock
  "minW": 0.18,         // shortest bar, in units of the native 20px bar
  "maxW": 2.6,          // longest bar (panel slider goes up to 4 = 80px)
  "minH": 2,            // thinnest bar (px) — 2 is the app's native thickness
  "maxH": 7,            // thickest bar (px) — keep <= 8, marks are 10px apart
  "gamma": 0.6,         // response curve: <1 punchier, >1 calmer
  "gate": 0.02,         // noise floor: bands below this count as silence
  "agcMix": 0.6,        // dynamic contrast: compare each band with its own slow baseline
  "atkMs": 35,          // attack / release time constants of the bars
  "relMs": 120,
  "silentMs": 450,      // how long after the last audible frame the rail resets
  "fps": 30,            // capture frame rate
  "tapIdleMs": 20000    // stop the capture helper after this much idle time
}

Every value is validated and clamped on the way in, a bad value keeps the previous setting rather than corrupting the file, and the write is atomic (temp file + rename).

Live apply without editing files (the port is the one in DSH_WEB_URL):

$port = ([uri]$env:DSH_WEB_URL).Port
Invoke-WebRequest -UseBasicParsing -Method POST -ContentType 'application/json' `
  -Body (Get-Content -Raw $env:USERPROFILE\.dsh\pulse-rail\config.json) `
  "http://127.0.0.1:$port/pulse-rail/config"

The routes only accept same-origin JSON requests: a cross-site request, a foreign Origin, or a POST without Content-Type: application/json gets 403. Plain local tooling (PowerShell, curl) and the DSH desktop shell are unaffected.

WantTurn
much more dramaticmaxW → 3–4, agcMix → 0.8–1.0
calmer / less busyagcMix → 0.3, gate → 0.05–0.1
thicker pumpingmaxH → 8 (max before the bars touch)
faster reactionatkMs → 15–25

How it works

default render device
   │  WASAPI shared-mode loopback (48 kHz, N-channel, float32)
   ▼
lib/pulse-tap.exe ── 1024-point FFT ──► 12 log-spaced bands (45 Hz – 15 kHz)
   │  one JSON line per frame on stdout, 30 fps
   ▼
host half (lib/index.js)  ──  GET /pulse-rail/state  ──►  browser half (lib/client.js)
                                    │                        │
                                    │                        └─ finds the rail, maps the 12 bands onto
                                    │                           however many marks are on screen right now
                                    └─ /pulse-rail/config, /pulse-rail/health, /pulse-rail/diag
  • Host half (lib/index.js + lib/tap.js): lazily spawns the capture helper, keeps the last frame, serves it on same-origin routes. The helper is killed after 20 s without a request, is restarted with back-off if it dies, and self-terminates if the host stops heart-beating it. A helper that is deliberately stopped can never be mistaken for a crashed one, so no orphan copy can survive; the packaged binary is verified by SHA-256 before it is executed.
  • Browser half (lib/client.js): locates the rail by geometry (narrow column of small marks near the right edge, with a button[data-index] fallback), re-maps every frame to the currently rendered mark count, and writes one custom property per mark. Length and thickness are both expressed as transform: scale() on the mark's ::before, with transform-origin: 100% 50%. Because the scroll container of the rail clips horizontally at 28 px, the plugin widens that container leftwards (right edge unchanged, hit area unchanged, pointer-events passed through) so long bars are actually visible.
  • Silence removes every override — the rail is byte-for-byte the app's own rendering again.

Privacy

The helper reads the system mix in memory and emits only band levels (12 floats) plus RMS/peak. No audio is recorded, buffered or written to disk. It runs only while the page asks for data and stops on its own 20 s after the last request; you can also watch it as pulse-tap.exe in Task Manager, or set "enabled": false.

Troubleshooting

GET /pulse-rail/healthhelper status: running / playing / pid / restarts / last error
POST /pulse-rail/restartrestart the capture helper
GET /pulse-rail/diaglast browser-side discovery reports (including locale resolution)
%USERPROFILE%\.dsh\pulse-rail\diag.jsonlrolling client diag log (256 KB, rotates to diag.jsonl.1)
%APPDATA%\@deepseek-ai\dsh-desktop\logs\crash-*-web-boot.logrenderer console.error lines (e.g. [dsh-pulse-rail] …)
lib\pulse-tap.exe --fps 30run the helper by hand and watch the JSON stream
Conversation squeezed to a thin strip / UI looks shifted left on long sessions0.4.0 regression — upgrade to 0.4.1 or later; reloading the window recovers temporarily (regression test: node tools/rail-target-test.mjs)
Some bars stop pulsing after scrolling / console spams sync …fixed in 0.5.0 (see docs/KNOWN-ISSUES.md #1, #2); if it still happens, attach GET /pulse-rail/diag
No pulse-rail row in the account popupthat popup is shell-rendered with no slot, so the row is DOM-injected; a DSH redesign of that menu can break it (the visualiser itself is unaffected). Attach the menu event from /pulse-rail/diag
Panel stays in the old language after switching DSH's languagethe plugin polls the locale every 700 ms, so it should follow within a second; if not, attach the locale event from /pulse-rail/diag

No sound in the bars? Play something and check /pulse-rail/state → playing. If running is false, look at lastError (a USB/Bluetooth endpoint that reports all-zero samples is re-initialised automatically after 5 s of silence).

Development

Everything below needs a source checkout — tools/ is not part of the npm package.

ToolWhat it does
node tools/host-test.mjs74 assertions against the real lib/index.js on a minimal webServer: routes, config validation and atomic write, request gate, capture-process lifecycle, diag rotation, helper staging
node tools/settings-ui-test.mjsheadless Edge: the account-menu row is injected, the popover never covers the rail, all 11 sliders write back, settings.section registers, and the panel follows en / zh-Hant / zh-Hans (including when the host never fires locale.subscribe)
node tools/silk-parity.mjsproves the shipped renderer's numbers are bit-for-bit the same as 0.4.x (2 402 value comparisons)
node tools/rail-target-test.mjsregression: on a 121-turn session the tag must land on the rail scroller only, conversation width unchanged
node tools/curve-test.mjs144 assertions for the spectral-shaping toolkit (__curve)
tools/verify-install.mjsquickest live sanity check: route registration + helper frames
tools/harness.mjs (+ page.mjs)offline bench that replicates the rail DOM/CSS and reports every bar's measured geometry
tools/cdp-check.mjsheadless Edge + CDP: samples ::before transforms, right-edge alignment and hit-testing
tools/mktone.py, tools/mkmusic.pygenerate test tones / pseudo-music

Rebuild the helper whenever pulse-tap.cs changes:

"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" /nologo /platform:x64 /optimize+ ^
  /out:lib\pulse-tap.exe lib\pulse-tap.cs

Uninstall

  1. remove "dsh-pulse-rail" from dsh.profile.bundles (and from dependencies),
  2. delete node_modules\dsh-pulse-rail,
  3. optionally delete %USERPROFILE%\.dsh\pulse-rail\,
  4. restart DSH.

License

MIT — see LICENSE.

What's new in 0.5.0

  • The settings moved into the app, in two places. The floating ♪ button is gone: pick Pulse rail settings in the bottom-left account popup, or open the same page in DSH Settings. The popover is a 300 px window pinned to the bottom-left and at most min(58vh, 440px) tall, so the rail stays visible and you can drag a slider while watching the bars react.
  • The panel follows DSH's language. Simplified and Traditional Chinese get the Chinese panel; every other language gets English. Labels are rewritten in place — no restart.
  • The long-standing “some bars stop pulsing after scrolling” bug is fixed, together with the [dsh-pulse-rail] sync … console spam that came with it.
  • The host half was hardened. Saving the configuration can no longer orphan a capture helper; configuration is validated, clamped and written atomically (a failed write now reports an error instead of claiming success); cross-site requests to the plugin's routes are rejected; the shipped capture binary is verified by SHA-256 before it runs; diag.jsonl rotates instead of being wiped.

Full detail, including every fix and the test matrix: CHANGELOG.md.

Known issues

  • No known functional defects in 0.5.0. History — including the two problems fixed here — is in docs/KNOWN-ISSUES.md. The CURVE-1.3 candidate remains archived and unreleased (it fixed a real defect but showed no demonstrable improvement in real-session A/B runs).
  • The account-menu row is injected, not native. That popup is shell-rendered and has no extension slot, so the plugin clones the native item. A future DSH redesign of that menu can make the row stop appearing — the visualiser itself is unaffected. GET /pulse-rail/diag reports menu events.
  • The plugin's routes carry no authentication of their own — authentication belongs to DSH. Cross-site and foreign-origin requests are now rejected, but any process running as you can still read and write the configuration.
  • Windows only. WASAPI loopback has no macOS or Linux backend, and on endpoints that report all-zero samples (some USB/Bluetooth devices) the helper re-initialises itself instead of pulsing.
  • Language is resolved by polling. The panel re-checks DSH's locale every 700 ms instead of relying on the host's locale.subscribe callback, which in practice does not fire on every switch. Expect up to ~1 s of lag after changing the language.

Plugins associés