rowboat/apps/x/packages/core
Prakhar Pandey a1db0e395a feat: Sign in with ChatGPT — OAuth sign-in, token storage, and settings UI
Lets users connect their ChatGPT Plus/Pro subscription instead of pasting
an API key. Sign-in half only: the codex model client consumes the session
via getChatGPTAccessToken().

- PKCE OAuth against auth.openai.com using the official Codex CLI public
  client id (constants verified against the openai/codex sources); system
  browser + loopback callback server on the pre-registered fixed port
  127.0.0.1:1455, state validated, stale callbacks rejected
- token store (core): single config/chatgpt-auth.json holding non-secret
  display fields (email, accountId, expiresAt) plus the token material
  encrypted via the safeStorage cipher bridge (plaintext-with-marker
  fallback when no keychain, matching the GitHub token path); no token
  value ever written in the clear or logged
- getChatGPTAccessToken(): single-flight refresh within 5 min of expiry;
  refresh rejection (400/401) clears to a clean signed-out state and
  throws typed ChatGPTAuthRequiredError; 5xx/network kept as transient
- sign-out with best-effort token revocation
- IPC chatgpt:getStatus/signIn/cancelSignIn/signOut — raw tokens never
  cross to the renderer; real cancellation settles the in-flight attempt,
  frees the port, and a retry starts a fresh attempt (new PKCE/state)
- settings UI: ChatGPT Subscription section on the OpenAI card
  (sign in / waiting + cancel / connected as {email} + sign out) via a
  useChatGPT hook

Vitest covers the token store, single-flight refresh, and
transient-vs-terminal refresh handling.
2026-07-17 17:23:46 +05:30
..
docs fix(x): cancellation no longer requires live dependency materialization 2026-07-11 10:59:42 +05:30
scripts Code mode: make packaged builds work via managed engine provisioning (#625) 2026-06-17 21:53:15 +05:30
src feat: Sign in with ChatGPT — OAuth sign-in, token storage, and settings UI 2026-07-17 17:23:46 +05:30
.gitignore bootstrap new electron app 2026-01-16 12:05:33 +05:30
package.json chore(x): migrate to AI SDK 7 2026-07-13 16:22:36 +05:30
tsconfig.build.json Refactor builtin file tools beyond workspace scope 2026-05-25 16:21:51 +05:30
tsconfig.json feat: extract presentation generator into executable code with builtin tool 2026-01-30 13:30:06 +05:30
vitest.config.ts Refactor builtin file tools beyond workspace scope 2026-05-25 16:21:51 +05:30