fix: route PAT login through pi LoginDialog callbacks

The custom ctx.ui.custom login menu stole focus from pi's built-in
LoginDialog, so onPrompt never received keystrokes and PAT login
silently failed with 'No API key found'. Drive login via the provided
onPrompt/onAuth/onProgress callbacks instead, and drop login-ui.ts and
the now-unused pi-tui dependency. Also clears remaining lint warnings
by removing any-casts in models/oauth/stream/transform.
This commit is contained in:
Simon Shi
2026-06-16 13:39:16 +08:00
parent 842bec6eb2
commit bcaa66091e
10 changed files with 139 additions and 303 deletions
-1
View File
@@ -85,7 +85,6 @@ src/
├── index.ts # Extension registration
├── cosy.ts # COSY Signature and Machine ID resolver
├── login.ts # OAuth Device Flow + PAT login sequence
├── login-ui.ts # Custom TUI components for login
├── pat.ts # PAT → job-token exchange + identity resolution
├── models.ts # Model definitions and Dynamic Config Cache
├── oauth.ts # PAT / OAuth callback orchestrator