feat(client): add plans & quota sidebar panel, real-time session cost readout, and price table remote - #36
Open
xer-on wants to merge 1 commit into
Open
feat(client): add plans & quota sidebar panel, real-time session cost readout, and price table remote#36xer-on wants to merge 1 commit into
xer-on wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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