Introduction¶
The core architecture of DeepSeek Harness (DSH) is based on a plugin-oriented design. In real-world agent development or operations scenarios, managing multiple subscription accounts, monitoring quota usage, and tracking local runtime logs are common requirements. dsh-token-usage aims to provide DSH with a unified account and quota observation mechanism, as well as a local usage ledger, to solve the problem of tracking costs and subscription status in a multi-provider environment.
Plugin Positioning¶
This is a management and security plugin for DeepSeek Harness, focusing on account management, subscription quota observation, and local usage records. The plugin is maintained by shaomingbo and is open-sourced under the MIT License.
Core Capabilities¶
The plugin provides the following features, covering multiple layers from connection management to runtime diagnostics:
- Unified provider connections: Supports unified connection management across multiple providers.
- Account and quota observation: Provides subscription quota observation and supports recording a local usage ledger.
- Antigravity account pool: Supports account pool management with a master-detail view, including account activation, account removal, rotation within the pool, and automatic failover.
- Native
codex-runtime/v1capabilities: Provides an owner-bound nativecodex-runtime/v1capability interface. - Subscription login management: Supports subscription login status management, including
pending-loginand explicit cancellation operations. - SDK stream diagnostics: Provides SDK-level stream diagnostics and can identify four terminal states:
completed,failed,cancelled, andtimed-out. - Native compaction counters: Provides count statistics for the native compaction process.
Installation and Enablement¶
The plugin is distributed through the npm ecosystem. Before installing, make sure your runtime environment meets the dependency requirements (see the notes below).
- Check the Node.js version. According to
package.json, the plugin requires anodeversion greater than or equal to22.19.0. - Run the installation command:
npm install dsh-token-usage
After installation, the plugin is registered in the DSH plugin system. Based on the configuration, bin/install.js is executed to complete the required initialization setup.
Typical Usage¶
This plugin usually needs to be used together with specific companion components to fully leverage its diagnostic and compaction capabilities.
- Pair with a compaction component: To obtain complete diagnostic phases and compaction counting, it is recommended to pair this plugin with
dsh-codex-compaction0.3.2. - Enable optional diagnostics: When enabling compaction 0.4.0, you can activate optional diagnostic phases such as
completed,failed,cancelled, andtimed-out.
The plugin interacts with the DeepSeek runtime through native interfaces, using the codex-runtime/v1 seam to obtain underlying runtime status.
Notes¶
When using this plugin, please note the following facts:
- Data security: The plugin does not include telemetry data, prompts, or any key information in SQLite, RPC, logs, or exported data.
- Validation mechanism: Fake transfers and isolated pairing snapshots are validated independently of real model acceptance and are used only in test environments.
- Known non-blocking limitation: In compaction status, cancellation operations may display
CODEX_RUNTIME_ERROR. This is a known behavior and does not affect core functionality.
Conclusion¶
dsh-token-usage provides DSH with a solid foundation for account management and runtime diagnostics. If you need to deeply monitor the runtime status and account quotas of DeepSeek Harness, this plugin is a practical choice you can use directly.
- Plugin catalog: dsh-token-usage
- Source code: GitHub