sandbase-harness
sandbaseai
Local-first, self-hosted AI agent runtime and MCP bridge with sandboxed sessions, memory, credentials, audit/replay, and a local Console.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Hjay1101/dsh-plugin-token-usage
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A DeepSeek Harness plugin that read-only scans your local session logs and renders a GitHub-style token usage heat map with a granularity-linked per-model breakdown — plus an instant "tokens today" badge on hover. Everything stays on your machine.
Compatibility: targets the new-generation DSH architecture (≥
0.1.2-rc.1). The tool run-card registers in thetool.call.toolviewkey domain under the wire tool nameusage_report; the legacytool.view.cordis/selfslot is now owned by the dynamic Client Guard and no longer applies to static plugins.Both session-log generations are supported: the old
session.jsonl.zstd(assistant/chunk+chunk.usage) and the newsession.v3.jsonl.zstd(assistant/message+data.usage, model attributed per message source). When both coexist in one session directory only the highest version is read, so no stretch of history is counted twice.

08-22 · 420M token · 341 requests · 95.9% cache hit,
left-edge aligned to each cell, shown instantly (delayMs=0), viewport-aware flip.1.25亿token today, silent 30s polling, rolls over at
midnight automatically.--dsw-alias-*);
light/dark just work.usage_report model tool: ask your agent "how many tokens did I use today?"
without opening the panel.dsh plugin --profile web add dsh-plugin-token-usage
The package ships its own cordis.patch.yml bundle patch, so the host half (HTTP API +
model tool) activates automatically.
Put this directory into ~/.dsh/profiles/web/node_modules/
(or pnpm add file: it);
Append to ~/.dsh/profiles/web/cordis.patch.yml:
- insert:
- id: token-usage
name: 'dsh-plugin-token-usage'
config:
ttlMs: 15000
Restart DeepSeek Harness.
⚠️ Pick one. If the bundle patch already mounts it, do NOT manually insert the same id — that would double-load the plugin.
Upgrading from the manual install? If you previously added the
insertblock above to your profile, delete it before restarting — with the self-mounting bundle patch present, the same id would be registered twice and startup crashes withduplicate loader entry id: token-usage.
| Key | Default | Description |
|---|---|---|
ttlMs |
15000 |
Scan result cache duration (ms) |
scanTimeoutMs |
180000 |
Per-log decompression timeout (ms) |
usage_report (refresh forces a rescan,
top caps model rows — default 10, max 50).Read-only parsing of local logs under ~/.dsh/sessions/** (streamed zstd decompression,
8-way concurrency). No network requests, no telemetry, no writes.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: token-usage。