Skip to main content

dsh-ui-web/packages/dsh-full-stats

34Stars2Forks0Issues0Watchers

Overrides DSH's default conversation stats line: displays turns, steps, time elapsed, cache, and tokens with a running status indicator. Allows custom status text for three states: thinking, working, and completed.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki

ⓘ This plugin is a sub-package of the CAPTAIN1275/dsh-ui-web monorepo — stars and activity count the whole repository.

Language
TypeScript
License
Apache-2.0
Branch
main
dsh-plugindsh-plugin-marketdsh-plugins

Install

cmdweb profile
$ dsh plugin --profile web add @captain1275/dsh-full-stats

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin CAPTAIN1275/dsh-ui-web/packages/dsh-full-stats for me: review the repository at https://github.com/CAPTAIN1275/dsh-ui-web first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

At a Glance

dsh-full-stats replaces the truncated session statistics line in the DSH Web GUI official version with a full-line wrapped display of turns/steps/duration/first token/speed/cache hit/input-output token numbers, and adds an amber or green runtime status dot at the line start. It provides a collapsible configuration card in the "Web UI Plugins" group, allowing you to customize prompt text for three states: "thinking", "working", and "completed", while replacing the official hardcoded "Deep diving..." placeholder.

Core Capabilities

  • Complete session statistics display: Session-level slot component (id=stats, priority=-1) outputs ${turns} turns · ${steps} steps | LLM ${llmMs} · Tool calls ${toolMs} | Avg first token ${ttftMs/steps} | ${decodeTokens/sec} tok/s | Cache hit % | Input tok · Output tok, with full whiteSpace:normal without omission (src/client/index.ts:121-160).
  • Runtime status indicator dot: Renders an 8px dot at the line start, amber during active sessions (#f59e0b with 6px shadow), green when idle (#4ade80), with 0.15s transition when switching between sessions (src/client/index.ts:163-196).
  • Three-state custom text: Configuration card provides three input fields for "thinking/working/completed" states; leaving empty reverts to original content; after filling, displays corresponding prefix based on session state, followed by complete statistics (src/client/index.ts:152-159, src/client/FullStatsSettingsCard.tsx:104-137).
  • Overrides official "Deep diving..." placeholder text: MutationObserver monitors [class*="turnStatus"] nodes, replaces hardcoded "Deep diving..." text nodes in-place with thinkingText, preserving the clock span (src/client/index.ts:74-91).
  • Cross-process configuration persistence: Host page registers GET / PUT /api/full-stats/config, writes to ~/.dsh/full-stats.json ($DSH_HOME preferred, fallback to ~/.dsh); browser configuration card saves and dispatches dshc-full-stats-config event after save, statistics line refreshes instantly (src/index.ts:69-92, src/client/FullStatsSettingsCard.tsx:73-85).
  • WebUI settings card integration: Registers in web-ui.plugin.item slot with id=full-stats (order=120), appears alongside task board and skin center in DSH Web settings page (src/client/index.ts:218-226).

Technical Implementation

  • Language: TypeScript (ESM, TSX + CSS Modules; compiled with tsdown, target es2024, jsx react-jsx)
  • Key Dependencies: @deepseek-ai/cordis (host plugin runtime, registers webServer routes), @deepseek-ai/dsh-client-runtime and @deepseek-ai/dsh-client-ui-conversation (browser half injected targets), react ^18.2.0 (memoized FullStatsLine and FullStatsSettingsCard rendering)
  • Architecture Pattern: Cordis dual-half plugin — src/index.ts is the host half (ctx.inject(['webServer'], ...) registers GET/PUT routes for /api/full-stats/config + reads/writes ~/.dsh/full-stats.json, no-op without webServer), src/client/index.ts is the browser half (ctx.slots.inject overrides conversation.composer.dock#stats slot + registers web-ui.plugin.item#full-stats configuration card + listens to host routes and dshc-full-stats-config events); cordis.patch.yml registers plugin id=ui-full-stats, package.json#dsh.client declares platform: "web", inject: [dsh-client-runtime, dsh-client-ui-conversation].
  • Entry Files: src/index.ts (host half entry, apply registers config routes), src/client/index.ts (browser half entry, overrides statistics line + MutationObserver replaces Deep diving + registers config card), src/client/FullStatsSettingsCard.tsx (collapsible config card UI), src/client/card.module.css (card styles, reuses official ui-plugin-config tokens)

Use Cases

Users who run project sessions in DSH Web GUI and want to instantly see the numbers for "how many steps, LLM vs tool time, first token latency, cache hit rate" in the current turn; plus players who want to customize the official "Deep diving..." message (e.g., changing to something like "Fatty fish is eating rice").

Prerequisites & Compatibility

DependencyMin VersionDescription
DSH0.1.0-rc.6devDependencies locks @deepseek-ai/dsh-client-runtime and @deepseek-ai/dsh-client-ui-conversation to ^0.1.0-rc.6, @deepseek-ai/cordis to ^4.0.1 (package.json:33-42)
Client profilewebcordis.patch.yml registers id: ui-full-stats, name: '@captain1275/dsh-full-stats'; package.json#dsh.client.platform is web, inject includes dsh-client-runtime + dsh-client-ui-conversation; browser half won't load under headless/CLI profiles (cordis.patch.yml:1-4, package.json:13-23)
React^18.2.0Browser half React 18 rendering (package.json:42)
Node.jsNot declaredNeither root package.json nor this package's package.json has engines field; host half only uses node:fs / node:path / node:os / node:http standard library (src/index.ts:11-13)
PlatformCross-platform (macOS / Windows / Linux)Only depends on Node standard library, no native bindings; host half path handling auto-adapts via path.join for win32
Native modulesNoneNo koffi / node-pty / node:sqlite or other native bindings; tests use [email protected] (package.json:34-42)

Installation

dsh plugin --profile web add github:CAPTAIN1275/dsh-ui-web/packages/dsh-full-stats

After installation, restart DSH Web and enter any project session to see the complete statistics line and status dot below the conversation dialog; a collapsible "Full Stats (Status Text)" configuration card will also appear in DSH Web Settings → Web UI Plugins group.

Configuration Options

ConfigTypeDescriptionDefault
Thinking state text (replaces Deep diving...)stringReplaces official hardcoded "Deep diving..." placeholder during session thinking phase; empty shows original textEmpty
Working state textstringCustom prefix displayed before statistics line when session is generating a response; empty shows only statisticsEmpty
Completed state textstringCustom prefix displayed before statistics line when session is idle and non-empty; empty shows only statisticsEmpty

After filling these three text fields in the "Full Stats (Status Text)" card on the browser side, they are PUT to /api/full-stats/config and persisted to ~/.dsh/full-stats.json, then a dshc-full-stats-config event is dispatched to instantly refresh the statistics line.

FAQ

Q: Where can I see it after installation?

A: Enter any project session in DSH Web GUI, and you'll see a non-truncated statistics line below the conversation dialog (turns/steps/LLM and tool duration/first token/speed/cache hit/input-output tokens) with an amber or green status dot at the start; a collapsible "Full Stats (Status Text)" configuration card will also appear in DSH Web Settings under the Web UI Plugins group.

Q: Where is the config saved? Will it be lost if I uninstall or switch machines?

A: The three text fields are written to the host process side's ~/.dsh/full-stats.json (reads $DSH_HOME environment variable by default, falls back to ~/.dsh); the PUT interface validates field types and overwrites on write. You'll need to manually migrate this JSON file when switching machines; uninstalling the plugin doesn't delete this file.

Q: Which official text does "Thinking state text" replace?

A: It replaces the hardcoded "Deep diving..." placeholder text in the official ChatView inline JSX. The client uses a MutationObserver to monitor [class*="turnStatus"] nodes, matches that string, and replaces it in-place with the user-configured text; the clock span is preserved, only the text node is replaced.

Q: How do the three state texts trigger to display?

A: When session is running + workingText is non-empty, displays the "working" prefix; when session is idle and non-empty + doneText is non-empty, displays the "completed" prefix; if any configuration is an empty string, reverts to the original statistics line without custom prefix.

Q: Will it replace DSH's official statistics line? What about conflicts with other similar plugins?

A: It overrides rather than coexists. The browser half re-registers in conversation.composer.dock slot with same id=stats but lower priority=-1; rendering order between DSH's official component and this plugin's component is determined by priority. This plugin's source code doesn't have special mutual exclusion handling for similar plugins like dsh-live-stats.

Q: Is there a size limit on the config interface?

A: Yes. Requests to PUT /api/full-stats/config with body exceeding 100,000 bytes are rejected by the server and the request is destroyed (reject(new Error('body too large'))); the three text fields combined are far below this limit, so normal input won't trigger it.

Q: Must it be DSH Web to use?

A: Yes. package.json#dsh.client.platform is set to web, the browser half depends on DSH client runtime; the host route /api/full-stats/config is also mounted on DSH Web's webServer, won't load in headless/CLI mode.

Q: Will the statistics line automatically revert to official style after uninstall?

A: Yes. This plugin uses priority=-1 to replace the official id=stats; after plugin uninstall, that override disappears, and DSH Web's built-in statistics line restores — but the official original style is still a truncated whiteSpace:nowrap line.

Difficulty Level

Beginner — install the plugin and restart DSH Web to see the effect; to customize status text, go to Settings page → Web UI Plugins group → expand "Full Stats (Status Text)" and fill in the three text fields, no manual config or command line needed.

Known Issues & Limitations

  • Config interface request body limit of 100,000 bytes: PUT /api/full-stats/config directly reject(new Error('body too large')) and req.destroy() for requests exceeding this threshold in readBody; the current three text fields cannot trigger this, but be aware if extending fields in the future (src/index.ts:54-67).
  • Custom status text prefix only works with "non-empty config": When thinkingText is empty, mountThinkingTextReplacer returns directly; when workingText/doneText is empty, that branch is skipped and reverts to original statistics line — all three text fields must be filled for full effect (src/client/index.ts:76, src/client/index.ts:152-159).
  • cachedConfig is a module-level singleton: let cachedConfig at src/client/index.ts:46 may retain old values in scenarios with multiple plugin instantiations or HMR; config is refreshed via dshc-full-stats-config event after save, but stale data may still be read when events don't fire (src/client/index.ts:46-63, src/client/index.ts:200-203).
  • Strongly depends on official DOM selectors and hardcoded text: mountThinkingTextReplacer uses [class*="turnStatus"] and text "Deep diving..." to match official nodes; will directly become ineffective if official ChatView refactors (class name changes or text i18nization) (src/client/index.ts:74-91).
  • Aggregate package dsh-web-ui-all won't auto-load this plugin: aggregate.yml places dsh-full-stats in deps: but doesn't list it in patchFrom:, so dependency-only installation won't inject ui-full-stats into the profile registry — users of the aggregate package need to manually add @captain1275/dsh-full-stats to dsh.profile.bundles (packages/dsh-web-ui-all/aggregate.yml:21-31, README.md:97-110).

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/CAPTAIN1275/dsh-ui-web/packages/dsh-full-stats)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory