DeepSeek Harness plugin developers often need to pay attention to API price fluctuations and account balances. If billing peaks occur during development, requests may fail; insufficient balance can also interrupt workflows. dsh-tidewatch aims to solve this pain point by integrating time-period status and balance information directly into the development environment interface.

What is this

The plugin is a DeepSeek Harness plugin that displays a floating card in the upper-right corner of the page showing the DeepSeek API peak/off-peak period, countdown, and account balance.

Core features

  • Real-time period status indicator: Determines whether the current time is peak or off-peak based on DeepSeek’s official pricing rules. Peak hours are Beijing time Monday to Friday 09:00-12:00 and 14:00-18:00; all other periods are off-peak, with prices halved.
  • Beijing clock + countdown: Shows how much time remains until the next period switch, updating every second.
  • Account balance: Queries the balance after an API Key is configured, refreshing automatically every 5 minutes.
  • Draggable and collapsible: Drag the title bar to reposition it; click “-” to collapse it.

Installation and enabling

The plugin is available in two forms:

  • Persistent plugin: Available at startup and across all sessions. Install it using the command:
    dsh plugin --profile web add /path/to/dsh-tidewatch
After loading, the package's `cordis.patch.yml` is applied automatically. Restart the profile for the changes to take effect.
  • Dynamic plugin: Only for the current session and in-process. Define it in a DSH session with cordis_define, then activate it with cordis_run. A dynamic plugin exists only in the current process memory and disappears when DSH restarts. For long-term use, Option A is recommended.

Configuring the API Key

By default, the plugin reuses the model credentials configured in Harness. The resolution order is as follows:

  1. The credential reference for the provider of the currently active model — it obtains the provider id from agentDefaultModel.currentSelection(), then uses llm.listConfigurableProviders() to locate the configuration object and reads its apiKeyEnv.
  2. The Key manually saved by the user in the panel (environment variable DSH_PLUGIN_DEEPSEEK_KEY).
  3. The fallback environment variable DEEPSEEK_API_KEY.

The top of the panel shows the current model and provider and provides a data source dropdown; selecting an option switches the data source.

Security notes

  • The Key is never returned to the browser: The frontend only receives the credential reference name, source, and availability, plus the balance value.
  • Balance requests are executed by the Host: The Key is passed via environment variables, never appears on the command line, and is not written to logs.
  • Balance API limitation: Only DeepSeek-compatible providers support it (<baseURL>/user/balance); other providers are marked as unsupported.

Technical implementation

The plugin uses connection.fetch to register the route (POST /api/dsh-tidewatch) instead of connection.rpc. This is due to injection limitations in the current host implementation: accessing owner.webServer inside rpc.handle necessarily throws an error, causing route registration to fail. The registration path for connection.fetch does not go through owner.webServer and is therefore unaffected.

How changes take effect

  • Client side (lib/client.js): After changes, refresh the page; no build step is required.
  • Host side (lib/index.js / lib/tide.js): Changes require restarting the DSH profile.

Technical catalog and repository