title: Update User Model with GitHub fields

description: Add GitHub OAuth fields to User model: githubId, githubUsername, githubAccessToken, githubRefreshToken, githubEmail, avatar, emailVerified. Make passwordHash optional when githubId exists. Add indexes for githubId and email.

status: closed

issue_type: task

created_by: jarancibia

close_reason: done


title: Remove node-pty from package.json

description: Remove 'node-pty' from dependencies in package.json. It is no longer a hard dependency — it is replaced by the multi-backend abstraction (NodePtyBackend, StdPtyBackend, BasicSpawnBackend). See plan.txt.

status: open

labels: refactor terminals


title: Add global settings support for GitHub OAuth

description: Implement global settings system override for GitHub OAuth credentials. Settings keys: github.oauth.clientId, github.oauth.clientSecret, github.oauth.callbackUrl. Global settings take precedence over env vars.

issue_type: enhancement


title: Write tests for GitHub OAuth flow

description: Add unit tests for GitHub service and integration tests for OAuth flow in src/controllers/auth.controller.test.js


title: Update .env.example with GitHub OAuth vars

description: Add GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, GITHUB_CALLBACK_URL environment variables to .env.example


title: Create GitHub Service

description: Create src/services/github.service.js with OAuth URL generation, access token exchange, user info retrieval, token refresh logic, and error handling.


title: Update documentation

description: Update README.md and docs/features/auth-and-jwt.md with GitHub OAuth setup instructions and API documentation


title: Update Auth Controller with GitHub methods

description: Add githubLogin, githubCallback, and githubRefreshToken methods to src/controllers/auth.controller.js. Handle user creation, account linking, and JWT generation.


title: terminals.service.js: implement PTY backend abstraction

description:
Extract PTY operations into a PtyBackend interface with three implementations:
- NodePtyBackend: tries require('node-pty'), wraps spawn/write/resize/kill/onData/onExit
- StdPtyBackend: uses Node.js stdio:'pty' (Node 22+), SIGWINCH for resize
- BasicSpawnBackend: child_process.spawn fallback (no PTY, no resize)

Implement runtime detection/selection logic (best available). Add backendType to session metadata. See plan.txt.


title: terminals.service.test.js: update tests for three backends

description:
Update unit tests for terminals.service.js:
- Mock all three backend types (NodePty, StdPty, BasicSpawn)
- Test backend selection logic (mock node-pty available, unavailable)
- Test session CRUD for each backend
- Test resize/write/kill behavior per backend
See plan.txt.

labels: refactor terminals tests

type: parent-child


title: Update terminals-module.md docs for multi-backend architecture

description:
Update docs/features/terminals-module.md:
- Document the three backend modes (NodePty, StdPty, BasicSpawn)
- Show capabilities per backend (resize, PTY support)
- Note which backend is used automatically
- Consider adding NODE_PTY_BACKEND env var documentation
See plan.txt.

labels: docs refactor terminals


title: Update Auth Routes

description: Add GET /auth/github, GET /auth/github/callback, and POST /auth/github/refresh-token routes to src/routes/auth.routes.js