Back to home

Crayonnan

DeepSeek-harness-Extension

No description

Stars
0
Language
JavaScript
Created
Aug 16, 2026
Updated
Aug 16, 2026

Introduction

dsh-quota-bar

English | 中文

A lightweight quota bar plugin for the DeepSeek Harness web GUI — a pill in the session header showing your current quota, with a dashboard for usage, balance, cache-hit rate and per-model spend.

Features

  • Quota pill (session header, right edge): OpenCode Go plan usage — worst-window remaining % — or DeepSeek API account balance.
  • Dashboard on click:
    • Quota row: OpenCode Go three usage windows (5h rolling / weekly / monthly, % used + progress bar + plan limit + reset time) or the DeepSeek balance card (total / topped-up / granted).
    • Session chips: cache-hit rate, input / output tokens, context occupancy (live from host projections).
  • Model spend: per-model tokens and estimated USD cost across all durable session logs, with horizontal cost-share bars and a total.
  • Provider auto-detected from the default model; API keys resolve through the DSH credentials seam and never leave the host.

Design

Dual-face Cordis plugin (no build step, plain ESM):

PartFileRole
Hostindex.jsTypertRemoteService with two RPC methods: status() fetches live quota/balance from the provider endpoints; usage() zstd-decodes every session log (~/.dsh/sessions/**/session.jsonl.zstd), folds per-(turn,step) usage samples attributed to the model of the latest request/header, and prices them with the pi-ai catalog (USD / 1M tokens, ~15s cache).
Clientclient.jsHand-written browser bundle registering a conversation.session.header.utilities slot entry; renders the pill + dashboard; reads live tokenUsage / contextPressure session projections.
Manifesttypert.host.jsStrict-mode zod schemas for both RPC methods.

Install

dsh plugin --profile web add "github:Crayonnan/DeepSeek-harness-Extension"

Add to $DSH_HOME/profiles/web/cordis.patch.yml:

- insert:
    - id: quota-bar
      name: 'dsh-quota-bar'

Restart dsh web.

Network-restricted? If codeload.github.com is unreachable: dsh plugin --profile web add "git+https://github.com/Crayonnan/DeepSeek-harness-Extension.git"

Configuration

- id: quota-bar
  name: dsh-quota-bar
  config:
    opencodeUsageUrl: https://opencode.ai/zen/go/v1/usage  # default
    deepseekBaseUrl: https://api.deepseek.com              # default
    timeoutMs: 15000                                       # default
    sessionsRoot: <absolute path>                          # optional; default $DSH_HOME/sessions
    modelCosts:                                            # optional; overrides catalog pricing (USD / 1M tokens)
      kimi-k3: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 0 }

Pricing priority: built-in table < pi-ai catalog (<provider>.json) < modelCosts.

Uninstall

Remove the patch row, then dsh plugin --profile web remove dsh-quota-bar.

License

MIT