Add the session used for authenticated API calls: it sends x-pm-uid,
the bearer token, x-pm-appversion and the Proton Accept header, decodes
failures into api.Error, and on HTTP 401 refreshes the tokens and
retries once. Refresh is single-flight, first adopts tokens another
session saved to the shared store, and on a rejected refresh token
returns a fatal "session expired" error without clearing the stored
credentials or retrying the refresh. The session also tracks the
server's clock from the Date header.
The app version maps development builds to the "alpha" channel, as
Proton's x-pm-appversion grammar has no "dev" channel.
The fake server gains users, sessions, single-use refresh tokens and
401 for invalid access tokens on authenticated routes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>