Add explicit consent for read-only agent registration
Add a sign-in and explicit consent page for the new personal read-only agent registration flow. At /oauth/claim, the account holder reviews the one-hour scope, enters the six-digit code displayed by their agent, and approves or declines. Account switches cannot reuse another account's loaded consent or submitted code.
The client sends Privy credentials only to the configured OAuth issuer, validates the fixed personal read policy, and reloads single-use tickets after failed submissions. OAuth pages are excluded from page analytics, including navigation after the analytics script has already loaded.
Validation:
- 31 OAuth/client/component tests and 22 Chromium browser tests pass.
- Full app TypeScript (after Next type generation), OAuth TypeScript, and scoped lint pass. CI also type-checks the changed root layout.
- Mobile (390 × 844) and desktop (1280 × 900) rendered checks confirm readable controls and no horizontal overflow.
The page requires both OAUTH_CONSENT_ENABLED=true and OAUTH_AGENT_REGISTRATION_ENABLED=true; registration defaults off. Deploy with the companion API and database changes, verify chat sign-in before enabling API discovery, and complete the account-holder smoke test before reporting live readiness.
Browser tests use synthetic account fixtures. Merge and rollout await user approval.
Companion PRs: API #1052 and Database #118.
The lifecycle is isolated in useAgentClaim, with strict response schemas separate from HTTP transport. Malformed responses show a fixed verification error. Regression tests cover account and attempt switches, submitting a fresh ticket after retry, the complete endpoint, and rejection of unexpected entitlement metadata. The same component cases run in jsdom and Chromium.