Commit Graph

5 Commits

Author SHA1 Message Date
Vantz Stockwell
9e1b8d7b61 fix: match Claude Code's OAuth params exactly — add code=true and full scopes
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 1m3s
Claude Code sends code=true param and requests all 5 scopes:
org:create_api_key user:profile user:inference user:sessions:claude_code
user:mcp_servers. Wraith was only requesting user:inference and missing
the code=true flag, which likely caused the token exchange rejection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 12:38:35 -04:00
Vantz Stockwell
999f8f0539 fix: OAuth token exchange — try JSON then form-encoded, show actual error in browser
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 1m2s
The callback page now shows the real error message instead of a generic
"Failed to exchange" message. Token exchange tries JSON Content-Type first
(matching Claude Code's pattern) with form-encoded fallback. Full response
body logged for debugging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 11:48:54 -04:00
Vantz Stockwell
75afa70155 fix: OAuth redirect URI must use localhost not 127.0.0.1 + wire vault/connections/import to Go backend
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 1m4s
2026-03-17 10:28:48 -04:00
Vantz Stockwell
fbd2fd4f80 feat: wire real Claude API — OAuth login + live chat via Wails bindings
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 1m2s
Replace mock responses in the XO copilot panel with real Wails binding
calls to the Go AIService backend:

- StartLogin now opens the browser via pkg/browser.OpenURL
- SendMessage returns ChatResponse (text + tool call results) instead of
  bare error, fixing the tool-call accumulation bug in messageLoop
- Add GetModel/SetModel methods for frontend model switching
- Frontend useCopilot composable calls Go via Call.ByName from
  @wailsio/runtime, with conversation auto-creation, auth checks, and
  error display in the chat panel
- Store defaults to isAuthenticated=false; panel checks auth on mount
- CopilotSettings syncs model changes and logout to the backend

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:22:07 -04:00
Vantz Stockwell
7ee5321d69 feat: AI copilot backend — OAuth PKCE, Claude API streaming, 16 tools, conversations
Some checks failed
Build & Sign Wraith / Build Windows + Sign (push) Has been cancelled
- OAuth PKCE flow for Max subscription auth (no API key needed)
- Claude API client with SSE streaming (Messages API v1)
- 16 tool definitions: terminal, SFTP, RDP, session management
- Tool dispatch router mapping to existing Wraith services
- Conversation manager with SQLite persistence
- Terminal output ring buffer for AI context
- RDP screenshot encoder (RGBA → JPEG with downscaling)
- Wired into Wails app as AIService

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 09:09:23 -04:00