The repository wallet — the last 20 spends
/owner/name/wallet lists the last 20 spends of one app, newest first, one
row each (#13298): the date (UTC), the amount in US dollars, what it paid
for (build #12 Fix the login: the run's kind and the issue or pull it
worked on), and a link to the run. Rows come from the usage ledger
(core/usage.ts), the provider's list price, not money charged. A run that
did not end well says so beside what it paid for.
- Who: whoever may read the app's spend, a writer (
canSeeOwnerFacts, as
the usage API). Anyone else gets the not-found page.
- Where: a link beside the statement in the app's settings → App; at the
terminal, owner/name — Wallet in the : palette while the repository is
open (j/k move).
- CSV:
/owner/name/wallet.csvdownloads those same rows (date_utc,dollars,paid_for,outcome,run)
through the shared formula-safe writer (actions/wallet_csv.ts: a cell starting =, +, - or @
is written as text). It reads readWallet, so the gate and the 20-row cap are the page's: anyone
else gets 404. The page links it; the terminal's wallet screen prints the path. It does not go
through exportRows, which reads a table of an app's own database; the ledger is the forge's.
- Speed: the read walks
usage_repo (repo_id, at)for twenty rows, no
scan and no sort, so it does not grow with the ledger
(test/wallet.test.ts counts its statements at 10,000 rows and reads the plan).
- Left out: paging beyond 20; the MCP (below) gives the summary, and
GET /api/v1/repos/:owner/:name/usage
gives the recent lines as JSON.
MCP
usage with { repo, kind: "wallet" } answers the balance and the three latest spends, amounts and balance written by the page's own money and balanceWords; a reader who may not see the wallet gets the page's not-found.