Cost by day
A repository's owner (anyone canSeeOwnerFacts names) reads what the crew spent on it in each of the last 30 days as a table: date, dollars, runs. The page is /:owner/:name/cost; the terminal's "Usage of a repository" screen opens with the same rows in the same words. Anyone else gets the page's not-found.
- Source: the usage ledger (
src/core/usage.ts), one line per ended agent run, read in one grouped query overusage_repo(repo_id, at)(src/core/cost_days.ts). - Days are UTC. The column header says so. A run is counted on the day it ended.
- Dollars are the provider's list price, to the cent.
- A day with no run shows
$0.00and 0 runs. - CSV:
/:owner/:name/cost.csv(the page's "Download CSV" link) answerstext/csvwithdate_utc,usd,runs, same rows and gate; a cell starting with= + - @gets a leading'(costCsv,src/data/export_csv.ts).
Tests: test/cost-days.test.ts (fixtures across a month boundary, the page, the terminal).
Days of credit left (#14072)
On a forge that runs on the host's included credit, the cost page (and the terminal's repository usage lines) opens with one line: "About 9 days of credit left." It is the credit left divided by the mean daily spend of the whole forge's ledger over the last 7 UTC days (src/core/credit_days.ts, creditDaysLine in src/actions/crew_means.ts), rounded down. With no spend in those days it says the credit is not running down; with none left, that it is spent. A forge with a model key of its own, or without included credit, shows no line. Test: test/credit-days-left.test.ts.