Conversation
|
Thanks for this — the three features are good work, and we want them. The problem is the base, not the features. This branch was forked from a So we did the rebase here instead and kept only the new work: #38 ports Four things had to change to make the new code work against the real package:
We also added the tests the features did not have (price table ↔ catalog join, the pricing honesty rules, the panel projection and refresh loop, the one-shot price controller): 447 passing, typecheck and build clean. Two points are open product decisions we would rather not make for you: the two surfaces are English-only by construction rather than via Happy to keep this PR open if you would like to rebase it onto |
|
Closing this as superseded — thank you @xer-on, the work itself shipped. All three features from this PR are now on
Why it was ported instead of mergedThis branch is based on a
That is why the branch is Where it lives now
The panel and the readout did need dsh 0.1.5 for the layout's keyed |
Summary
This PR introduces three major UI and client-side capability upgrades for the Command Code provider plugin:
sidebar.footer.action) that reveals current plan details, 5-hour and weekly quota depletion bars, monthly credit balances (limit - remaining), and token statistics, which opens a full dashboard in the center workspace column (mainslot).conversation.composer.dock) that decorates the official token-usage pill with session cost estimates in USD and adds per-token cost breakdown rows into the usage dialog.commandcode/prices) exposing official per-token rates (input, output, cache-read, cache-write) in USD per million tokens, factoring in weekday peak/off-peak pricing schedules.Key Features & Changes
1. Plans & Quota Sidebar Card & Center Dashboard
sidebar.footer.action(order1), placing it immediately above the Settings seat. Shows live status and opens the dashboard on click viactx.layout.selectPanel().mainslot ascommandcode-panel. Renders:limit - remaining).src/client/panel.tsso view-model logic and formatting can be tested without a DOM.2. In-Composer Session Cost & Dialog Breakdown
statsdock cell (which would break upstream i18n and formatting),src/client/session-cost-display.tsdecorates the existing token-usage button pill with dollar figures (e.g.· $0.02).MutationObserverondocument.bodyto match and inject cost lines directly into the token details dialog (Uncached input,Completion,Cache read,Cache write).commandcodeprovider.3. Model Pricing Remote (
commandcode/prices)src/model-prices.tsdefines official pricing rows matching Command Code docs in USD / 1M tokens.commandcode/pricesendpoint insrc/usage-wire.tsand wires it insrc/usage-remote.ts.Architectural Notes
src/client/panel.ts,src/client/session-cost.ts,src/client/prices.ts) are decoupled from React and JSX.main,sidebar.footer.action,conversation.composer.dock) are wrapped in defensive guards so individual surface failures cannot crash the entire plugin fiber.Verification