* Add formatting conventions * Add a fmt lint check * rely on defaults --------- Co-authored-by: Julius Marminge <[email protected]>
1.1 KiB
1.1 KiB
Plan: Unify Process and PTY Session Abstractions in ProcessManager
Summary
Refactor ProcessManager to use a single runtime-session interface for child-process and PTY modes.
Motivation
apps/desktop/src/processManager.tsmaintains parallel maps and branch-heavy logic.- New execution backends/providers will multiply complexity.
Scope
- Desktop process execution internals.
- Preserve public
ProcessManagerAPI.
Proposed Changes
- Introduce internal interface (e.g.
RuntimeSession):write(data)kill()- lifecycle/output event hooks
- Implement:
ChildProcessSessionPtySession
- Replace dual maps with one
Map<string, RuntimeSession>. - Keep output/exit event contract unchanged.
- Add tests for both implementations.
Risks
- PTY behavior differs by platform; abstraction must not hide required differences.
Validation
- Existing
processManager.test.tspasses. - Add PTY-path tests where feasible.
Done Criteria
- Manager no longer branches per backend in
write/kill/killAll. - Session backends are independently testable.