refactor: abstract tmux into ProcessManager interface#144
refactor: abstract tmux into ProcessManager interface#1442witstudios wants to merge 2 commits intomainfrom
Conversation
Introduce a ProcessManager interface that abstracts tmux operations behind a backend-agnostic API, enabling future support for alternative process managers (e.g. ConPTY on Windows). - Add src/core/process-manager.ts with ProcessManager interface and types - Add TmuxBackend class to tmux.ts implementing ProcessManager - Add src/core/backend.ts factory with getBackend()/setBackend()/resetBackend() - Add src/core/conpty.ts experimental ConPTY stub using node-pty - Update all imports across 25+ production files and 10+ test files - Add platform branching to terminal.ts (macOS/Windows/Linux)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (112)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
ProcessManagerinterface (src/core/process-manager.ts) that abstracts all tmux operations behind a backend-agnostic APITmuxBackendclass tosrc/core/tmux.tsimplementing the interface by delegating to existing functionssrc/core/backend.tsfactory withgetBackend()/setBackend()/resetBackend()and platform detection (win32 → ConPTY, else → tmux)ConPtyBackendstub (src/core/conpty.ts) usingnode-ptyas optional dependencygetBackend()callsterminal.ts— macOS (Terminal.app), Windows (wt.exe), Linux ($TERMINAL with gnome-terminal/konsole/xterm fallbacks)Test plan
npm run typecheckpasses (only pre-existingwstype errors remain)npm test— 631/632 tests pass; the 1 failure (serveDaemonCommand) is pre-existingbackend.jsinstead oftmux.jsppg spawn,ppg status,ppg killwork as before