rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Lanstzz/sapi-budget
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A DeepSeek Harness plugin that syncs the per-group model prices from an
AiSpot (sapi) deployment and shows what each
conversation costs — a session total in the conversation header and a per-turn
cost at the end of every assistant turn.
The group list is crawled from the provider, never hardcoded, so it follows the provider as groups appear and disappear. You pick the active group from a dropdown in the conversation header, and every historical number is re-priced immediately — no reload, no replay.
subtree(s) = own(s) + Σ subtree(children)).Money is never published by the host. The projection carries token buckets only, and the browser prices them against the live catalog — that is what makes a group switch re-price history instantly.
dsh plugin add github:Lanstzz/sapi-budget
Or from a local checkout:
dsh plugin add /absolute/path/to/sapi-budget
Then restart the app: the bundle is loaded at startup.
Runs on macOS, Windows and Linux. There is no platform branch anywhere in the
plugin: the host half is plain JavaScript that registers routes and a session
projection and writes nothing to disk, pricing comes from public HTTP endpoints,
and the stored group choice lives in the browser's localStorage. The UI uses
only theme tokens, so it follows the host's light and dark palettes.
All optional. Set them in your profile patch (cordis.patch.yml):
- id: sapi-budget
name: 'dsh-sapi-budget'
config:
baseUrl: https://aispot.swj0227.icu # any compatible deployment
group: '' # '' = let the provider pick the cheapest
currency: USD
refreshMinutes: 30
The group is normally chosen in the UI and persisted in the browser's
localStorage (sapi-budget.group); the config value is only a fallback.
Three public, unauthenticated endpoints on the provider:
| Endpoint | Used for |
|---|---|
/api/pricing |
model list, ratios and tiered_expr expressions |
/api/status |
quota unit and exchange rate |
/api/user/groups |
group names and per-group ratio multipliers |
Tiered expressions are evaluated by a hand-written tokenizer and recursive-descent
parser in pricing.js. There is no eval and no new Function.
估算 / estimate) in the UI.$0.00.| File | Role |
|---|---|
index.js |
Host half: pricing service, three HTTP routes, the sapiCost session projection, and the sapi_price agent tool |
client.js |
Browser half: the two slot entries, the group picker, and the tooltip bubble |
pricing.js |
Catalog fetching and the tiered_expr evaluator |
test/ |
45 host tests + 59 client tests |
probe-tooltip.mjs |
Structural check that the breakdown does not ride on a native title |
node --check index.js && node --check client.js && node --check pricing.js
node --test test/index.host.test.js # 45 pass
node --test test/client.test.js # 59 pass
node probe-tooltip.mjs # exit 0
HANDOFF.md records the architecture decisions and the traps that cost real time
(including why the cost breakdown must never be a multi-line native title on
macOS).
MIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。