Feat: Implement real GitHub Copilot Device Flow authentication UI

- Add IPC handlers for github-copilot:authenticate, isAuthenticated, disconnect
- Add schema definitions for new IPC handlers in shared/ipc.ts
- Implement Device Flow authentication button with real flow
- Show device code and verification URL to user when authenticating
- Automatically open GitHub verification page in browser
- Auto-load models after successful authentication
- Update GitHub Copilot model list (gpt-4o, gpt-4-turbo, gpt-3.5-turbo, claude-3.5-sonnet)
- Display loading state and error messages in UI
- Properly integrate with existing auth service

This fixes the broken authentication flow where the button didn't do anything.
This commit is contained in:
Rowboat Developer 2026-04-17 09:56:32 -05:00
parent 4f53f0af48
commit b7866e3067
5 changed files with 135 additions and 17 deletions

View file

@ -257,6 +257,39 @@ const ipcSchemas = {
})),
}),
},
'github-copilot:authenticate': {
req: z.null(),
res: z.union([
z.object({
success: z.literal(true),
userCode: z.string(),
verificationUri: z.string(),
expiresIn: z.number(),
}),
z.object({
success: z.literal(false),
error: z.string(),
}),
]),
},
'github-copilot:isAuthenticated': {
req: z.null(),
res: z.object({
authenticated: z.boolean(),
}),
},
'github-copilot:disconnect': {
req: z.null(),
res: z.union([
z.object({
success: z.literal(true),
}),
z.object({
success: z.literal(false),
error: z.string(),
}),
]),
},
'account:getRowboat': {
req: z.null(),
res: z.object({