chore(chat): migrate YouTube connector to Composio
Summary
Replaces the chat-side custom YouTube OAuth flow with the existing Composio connector path. Connect/disconnect/channel-info all go through `/api/connectors` and `/api/connectors/actions`. The legacy `/api/youtube/*` routes, the `youtube_tokens` Supabase helpers, and the four LLM-tool result components for login/channels/playlist/thumbnail are deleted (Composio's toolkit covers them). Revenue dispatch is kept since the api-side `get_youtube_revenue` MCP tool stays.
Pairs with api#494 and docs#XXX.
Test plan
- On preview, click Connect YouTube on an artist → Composio OAuth → returns to settings with the YouTube card showing connected
- ChannelInfo + ChatInputYoutubeButtonPopover render the artist's channel name, thumbnail, and stats
- Click logout → Composio reports disconnected, channel-info query invalidates
- In chat, ask the agent for YouTube channel stats / playlist videos / thumbnail upload — verify Composio actions fire
- Ask for YouTube revenue — verify the retained `get_youtube_revenue` MCP tool returns data
- `pnpm test` (53/53 green)
- `npx tsc --noEmit` clean for changed files
Summary by cubic
Migrates YouTube to Composio for auth and channel stats, removes legacy OAuth/UI, unwraps Composio responses, and moves connector state to React Query; keeps the custom revenue tool. Adds proper “YouTube” naming and a connector description so the settings card reads correctly.
-
Refactors
- Enable YouTube in
ALLOWED_ARTIST_CONNECTORS; connect/disconnect now useuseConnectors+useConnectorHandlers(shared React Query cache, in-flight disable, aria-labels). AddsonDisconnectSuccessto also invalidate["youtube-channel-info", accountId]and restoresauthorizeto returnnullon failure. useYoutubeChannelcallsYOUTUBE_GET_CHANNEL_STATISTICSviaexecuteConnectorActionApiwithpart: "snippet,statistics"; extractslib/youtube/fetchYoutubeChannel; query gated on Privyauthenticated.useYoutubeStatusnow derives from connectors and surfaces errors.- Adds
lib/composio/api/executeConnectorActionApito unwrap Composio’sToolExecuteResponse. Mapsyoutubeto “YouTube” informatConnectorNameand adds a YouTube description inconnectorMetadata. - Removes legacy
/api/auth/callback/google,/api/youtube/*, Supabaseyoutube_tokens, OAuth/analytics libs,types/youtube.ts, and unused chat UIs; keepsget_youtube_revenueMCP tool/UI with an inlined result type and fallback error message.
- Enable YouTube in
-
Migration
- Requires
api#494(Composio actions endpoint). Ensure the Composio YouTube connector is enabled; users must reconnect via settings. Legacy Supabaseyoutube_tokensare no longer used and can be cleaned up separately.
- Requires
Summary by CodeRabbit
-
Refactor
- YouTube integration now uses the connector system for auth, status, and channel data.
- Connect/disconnect flows and status checks moved to connector-driven behavior; UI now reacts to connector state.
-
Bug Fixes / Chores
- Removed legacy YouTube server endpoints and many legacy YouTube UI pieces (video dialogs, stats, channel displays, skeletons).
- Added YouTube to supported account connectors; connect button updated to use the connector flow.