kkbsgg/dsh-balance

kkbsgg★ 1JavaScript最后同步: 2026-08-19

在 GitHub 打开

README 摘要

dsh-balance DeepSeek Harness plugin that displays the selected model provider's account balance as a small text next to the composer's model seat, once a model (and its reasoning effort) is selected for the active conversation. How it works - Host half ( lib/index.js , a Cordis plugin) mounts one loopback HTTP route — GET /dsh-balance/balance?provider= — on the webserver. The route resolves the selected provider's own API key through the standard credentials service (the llm-deepseek section for the DeepSeek official route, the llm-pi-ai providers table for custom/other routes), then probes the provider's balance: DeepSeek-style GET /user/balance first, falling back to the OpenAI-style GET /v1/dashboard/billing/credit grants . The key never crosses the wire boundary. - Client half ( client/client.js , a web client plugin) registers a seat into the conversation.input.right slot (immediately beside the model selector). It subscribes to the active session's model-selection directory ( modelDirectories ), passes the selected provider to the route, and only renders after a model with a non-empty id is selected — an empty selection hides the text instead of retaining a stale balance. Pol…

在 GitHub 查看完整 README →
工具/开发dsh-plugin

分类