Introduction¶
DeepSeek Harness (DSH) adopts a plugin architecture, allowing users to enhance the desktop client experience through functional extensions. When using the OpenCode Go service, confirming the remaining quota typically requires switching pages or checking the sidebar, which interrupts the workflow. This plugin aims to solve this pain point by displaying quota information directly below the input box in the Web UI, enabling developers to monitor usage without leaving the current page.
Plugin Overview¶
Plugin Name: blibilijojo/dsh-plugin-opencode-go-quota
Maintainer: blibilijojo
License: MIT
Category: Client
This is a DSH plugin designed to display three quota windows for OpenCode Go—5-hour rolling, this week, and this month—within the Web UI composer dock. The plugin renders via the host’s native styles, ensuring visual consistency with DSH’s built-in capsule components.
Core Features¶
-
Three Quota Capsule Displays
Displays three pills in the dock area below the input box, corresponding to the 5-hour rolling, weekly, and monthly quotas respectively. By default, they do not occupy additional line height and are displayed side-by-side with DSH’s built-in statistics. -
Color Status Indication
The color of the quota capsules changes based on usage:
- Gray: Usage < 70%
- Yellow: Usage >= 70% and < 90%
- Red: Usage >= 90% -
Detail Overlay
Clicking any capsule opens an overlay displaying detailed progress bars, percentages, and the respective reset times. The overlay can be closed by clicking outside or pressing theEsckey. -
Settings Toggle and Configuration
The plugin provides a settings toggle to control whether capsules are displayed below the input box. In the OpenCode Go section of the settings page, you can enter or clear the API Key. -
API Key Security Management
The API Key is stored in DSH’s credential vault (key name:OPENCODE_GO_API_KEY) and is not written to the settings file. The browser side only receives a masked hint (e.g.,oc_sk_…D4K); the key is used exclusively within the Host process. -
Architectural Separation
The plugin adopts a front-end/back-end separation architecture: the Host process handles credential parsing, gateway requests, and route handling; the browser side is responsible only for rendering and UI interaction.
Installation and Activation¶
- Clone or download this repository to any local directory.
- Open DeepSeek Harness (Desktop version or
dsh web). - Run the following command in the plugin manager to install the local bundle:
plugin_manager action: install_bundle
target: <absolute path to this repository>
After installation, refresh the page. If a Key is configured, the three quota capsules will immediately appear below the input box.
Configuration¶
- Open DSH Settings and locate the “OpenCode Go” page under “Agent Presets”.
- Paste your
oc_sk_...key into the “API Key” input box and click save. - The three quota pills will immediately display below the input box.
- To hide them, turn off the “Show Quota” toggle.
How It Works¶
The plugin registers routes via DSH’s webServer, using the same Host/Origin validation mechanism as built-in plugins. The Host process handles credential parsing, calls the OpenCode gateway interface GET /zen/go/v1/usage, and caches the data. The browser side mounts onto conversation.composer.dock via injection, responsible only for rendering the three pills and the settings page.
Key files include:
- index.js: Host-side logic, handling credentials, gateway requests, and routes.
- client.js: Browser-side logic, responsible for rendering capsules and overlays.
- package.json: Declares the plugin manifest and injection points.
Notes and Limitations¶
-
Code Modification Effects
After modifying Host-side code (e.g.,index.js), you must restart DSH for the changes to take effect. DSH caches loaded Host modules. If only browser-side code (client.js) is modified, simply refreshing the page is sufficient. -
Subscription Type Support
This plugin only supports quota windows for OpenCode Go / Go Plus subscriptions. Zen Balance is not supported. -
Interface Dependency
The plugin relies on the OpenCode gateway interfaceGET /zen/go/v1/usage. If the upstream interface adjusts its path or return structure, plugin functionality may be affected and requires synchronized updates. -
Key Management
Keys are stored in the credential vault; uninstalling the plugin will not automatically clear them. To delete, click “Clear Key” on the settings page or manually remove the corresponding entry from the credential vault.
Summary¶
By integrating quota monitoring into the composer dock, this plugin simplifies the process for developers to check OpenCode Go usage. Its host-native styling and clear configuration interface make it a practical tool within the DSH ecosystem.
Project URL: https://github.com/blibilijojo/dsh-plugin-opencode-go-quota