dsh-gold-price: Always display domestic gold price in the DSH Web client sidebar

Preface

For peers developing DSH / Agents, when debugging the Web client to confirm domestic gold prices, the usual method is to switch to another market page or software, come back, and continue reading logs. The dsh-gold-price plugin skips this step: it permanently displays the latest price and change percentage of Gold 9999 at the bottom of the DSH Web client sidebar, and provides an openable “Domestic Gold Price” real-time panel. The plugin is maintained by douzhihao111, current version 0.1.0, license MIT. Below is an introduction to its features, installation methods, and practical usage points.

What is it

One-sentence positioning: A DeepSeek Harness (DSH) Web client plugin that embeds domestic gold price quotes into the sidebar and panel, allowing viewing without leaving the client.

The problem it solves is specific: Domestic gold prices are scattered across multiple contracts like Gold 9999, Gold T+D, Shanghai Gold, and Main Shanghai Gold. Manually checking requires looking at each one individually. The plugin displays them uniformly in one panel and keeps polling in the background. The plugin itself only displays data and does not involve trading commands, and clearly states it does not constitute investment advice.

Core Features

The capabilities introduced below are all from the plugin README and can be verified one by one.

Sidebar Persistent Ticker

  • Displays the latest price and change percentage of Gold 9999 at the bottom of the sidebar; clicking opens the full panel.
  • Retains the golden bar icon when the sidebar is collapsed.

Real-time Panel

  • Gold 9999 (Au99.99, Shanghai Gold Exchange) main quote: latest price, change amount, change percentage, open, previous close, high, low.
  • Three quote cards for Gold T+D, Shanghai Gold, and Main Shanghai Gold (Shanghai Futures Exchange).
  • Gold 9999 intraday trend chart, supports mouse hover to view prices at each minute point.
  • Trading / Closed status, market time, page refresh time, and manual refresh.

Refresh & Adaptation

  1. Refresh quotes every 5 seconds, refresh intraday charts every 30 seconds.
  2. Pause requests when the page is hidden and immediately refresh when it becomes visible again.
  3. Automatically adapt to light/dark themes and narrow windows.

Data Source

Quotes and intraday data come from the East Money public market interface, not scraped or forwarded by the plugin itself:

  • https://push2.eastmoney.com/api/qt/ulist.np/get (Quotes)
  • https://push2.eastmoney.com/api/qt/stock/trends2/get (Intraday trends)

Contract codes used:

Contract Code
Gold 9999 118.AU9999
Gold T+D 118.AUTD
Shanghai Gold 118.SHAU
Main Shanghai Gold 113.aum

Note that market data may be delayed, and the last quote is displayed outside of trading hours.

Installation & Enablement

The plugin is installed as a profile bundle. First build/prepare the current directory, then execute:

dsh plugin --profile desktop add /absolute/path/to/dsh-gold-price

Then add the package name to dsh.profile.bundles in the profile’s package.json:

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

After restarting Harness (or letting the configuration hot reload take effect), the gold price quote will appear at the bottom of the sidebar, and a “Gold Price” panel entry will appear in the sidebar navigation.

Uninstallation consists of two steps:

dsh plugin --profile desktop remove dsh-gold-price

And remove dsh-gold-price from dsh.profile.bundles.

Directory Structure & Implementation

The plugin source code is thin, consisting mainly of three files:

File Description
cordis.patch.yml bundle patch: inserts gold-price plugin row into profile
lib/index.js Host half: empty apply(), only provides Loader line
lib/client.js Browser half: data polling, shared market store, sidebar entry, real-time panel, and intraday chart

Key points to note in the implementation:

  1. Quotes and intraday data share a module-level store; the sidebar ticker and panel share the same polling, avoiding duplicate requests.
  2. Components subscribe to the store via useSyncExternalStore; when a component unmounts, the last subscriber stops all timers to prevent continued polling in the background.
  3. The browser half is pure JavaScript (no JSX, no build steps), delivered in the form of Harness’s window.__ModuleLoader__.load({ id, factory }), with React provided by the client module system.
  4. Three positions are registered via ctx.slots: main (panel), sidebar.panellist (panel entry), sidebar.footer.action (sidebar persistent ticker).

Runtime-related fields in package.json:

  • version: 0.1.0
  • license: MIT
  • engines.dsh: >=0.2.1-rc.5
  • dsh.bundle.patch: ./cordis.patch.yml
  • dsh.client.platform: web

Typical Usage

After installation and enabling, no additional configuration is needed for daily use:

  1. Open the DSH Web client to see the latest price and change percentage of Gold 9999 directly at the bottom of the sidebar.
  2. Click the gold price entry in the sidebar ticker or sidebar navigation to open the full panel.
  3. View the main quote, three quote cards, and intraday trend chart in the panel; hovering over the intraday chart shows prices at minute points.
  4. Click manual refresh when you need the latest data; switching the page to the background automatically pauses polling, and it refreshes immediately upon returning.

Applicable Scenarios & Notes

Suitable for users who need to keep the DSH Web client open for a long time, want to conveniently see domestic gold prices, or want to use the panel as a base for secondary development. The plugin only displays market data and does not contain trading functions; do not treat it as a market analysis or investment advice tool.

A few reminders:

  1. The plugin runs with the permissions of the current DSH process and can access the network and files accessible by the process. Before installing, check the source code and license (this plugin is MIT) to ensure third-party interface calls meet your environment requirements.
  2. Data relies on the East Money public interface; availability and latency are determined by the upstream provider, and the plugin does not modify the data source.
  3. Market data may be delayed, and the last quote is displayed outside of trading hours.
  4. The community directory site is an independent site and has no official affiliation with DeepSeek/FanHuan; do not treat it as an app store.

Conclusion

The value of dsh-gold-price lies in turning domestic gold price quotes into a native panel of the DSH Web client, reducing window switching when viewing quotes. It is lightweight and has a single responsibility, with a relatively restrained refresh strategy and theme adaptation. If you need to add a market display plugin to a profile you maintain, the structure of this repository (Host half only provides Loader line, browser half independent polling, registering three positions via ctx.slots) can serve as a reference.

Plugin Directory Page: https://www.skillhub.cn/plugins/douzhihao111/dsh-gold-price

GitHub: https://github.com/douzhihao111/dsh-gold-price

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye