refactor(cli): re-export fetchProfile from cli/status-api and land betas-shortcut characterization
The cli entry barrel used to re-export fetchUsage directly from
cli.ts; the status-API call site moved to src/cli/status-api.ts in an
earlier commit and now exports both fetchProfile and fetchUsage. This
commit wires the barrel back up to the new location and adjusts
cli.test.ts to the { data, error } envelope that status-api returns.
Source
- src/cli.ts: re-export { fetchProfile, fetchUsage } from
./cli/status-api.js instead of the old direct re-export.
Tests
- cli.test.ts: fetchUsage happy path returns { data: usageData,
error: null }; failure path returns { data: null, error: 'forbidden' }.
ensureTokenAndFetchUsage now reports profile + profileError alongside
usage. Mock fetches moved from json() to text() to match the
response-parsing contract the helper expects.
- tests/unit/betas-shortcut.test.ts (new): characterizes
resolveBetaShortcut (undefined/empty passthrough, case-insensitive
alias lookup across BETA_SHORTCUTS, trimmed input). 6 tests, all
pass. Pins the contract for the beta alias plan before any
betas/env reshuffling. V
Vacbo committed
c703ba00737986a9c7aa2c815ffb174635d389fe
Parent: edad3c3