feat: add MCP OAuth authentication frontend wiring and banner

- Add McpOauthRequiredEvent and McpOauthStaticClientConfigEvent to sidecar contracts
- Add PendingMcpAuthRecord domain type with status tracking (pending/authenticating/failed/done)
- Add pendingMcpAuth field to SessionRecord for session-level auth state
- Wire onMcpOAuthRequired callback through sidecarProcess, runTurnPending, and AryxAppService
- Handle mcp-oauth-required events: set session pendingMcpAuth, clear on turn finalize/cancel
- Add dismissSessionMcpAuth IPC channel with preload binding and handler registration
- Create McpAuthBanner component (amber-themed, shows server name/URL, dismiss button)
- Integrate McpAuthBanner into ChatPane with placeholder text and App.tsx callback
- Update test fixtures for new RunTurnPendingCommand.onMcpOAuthRequired field

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-27 19:09:11 +01:00
co-authored by Copilot
parent 192c28f721
commit f9757d5ce2
14 changed files with 196 additions and 2 deletions
+18
View File
@@ -244,6 +244,23 @@ export interface UserInputRequestedEvent {
allowFreeform?: boolean;
}
export interface McpOauthStaticClientConfigEvent {
clientId: string;
publicClient?: boolean;
}
export interface McpOauthRequiredEvent {
type: 'mcp-oauth-required';
requestId: string;
sessionId: string;
oauthRequestId: string;
agentId?: string;
agentName?: string;
serverName: string;
serverUrl: string;
staticClientConfig?: McpOauthStaticClientConfigEvent;
}
export interface ExitPlanModeRequestedEvent {
type: 'exit-plan-mode-requested';
requestId: string;
@@ -276,6 +293,7 @@ export type SidecarEvent =
| AgentActivityEvent
| ApprovalRequestedEvent
| UserInputRequestedEvent
| McpOauthRequiredEvent
| ExitPlanModeRequestedEvent
| CommandErrorEvent
| CommandCompleteEvent;