feat: add GNU screen wrapping with process monitor

Add screen session management infrastructure:
- ScreenManager class to create, track, and kill GNU screen sessions
- Persistence of screen sessions to ~/.claudeman/screens.json
- Process stats collection (memory, CPU, child count)
- Reconciliation to detect dead/orphan screens

New API endpoints:
- GET /api/screens - list screens with stats
- DELETE /api/screens/:sessionId - kill screen
- POST /api/screens/reconcile - find dead screens
- POST /api/screens/stats/start|stop - control stats polling

New Process Monitor panel:
- Slide-up panel with real-time stats (2s updates)
- Shows memory, CPU, child processes per screen
- Kill button for each screen session
- Reconcile button to clean up dead screens

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-19 02:18:51 +01:00
co-authored by Claude Opus 4.5
parent b30657a36f
commit 56c9f670e6
6 changed files with 606 additions and 0 deletions
+118
View File
@@ -1118,6 +1118,124 @@ kbd {
background: var(--border-light);
}
/* Process Monitor Panel */
.process-panel {
position: fixed;
bottom: var(--toolbar-height);
left: 0.5rem;
width: 400px;
max-width: calc(100vw - 1rem);
max-height: 50vh;
background: var(--bg-card);
border: 1px solid var(--border);
border-bottom: none;
border-radius: 8px 8px 0 0;
box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
z-index: 100;
transform: translateY(100%);
transition: transform 0.2s ease;
display: flex;
flex-direction: column;
}
.process-panel.open {
transform: translateY(0);
}
.process-panel-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.6rem 1rem;
border-bottom: 1px solid var(--border);
font-size: 0.8rem;
font-weight: 500;
flex-shrink: 0;
}
.process-panel-actions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.process-panel-body {
flex: 1;
overflow-y: auto;
padding: 0.5rem;
}
.process-empty {
padding: 1rem;
text-align: center;
color: var(--text-muted);
font-size: 0.8rem;
}
.process-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.6rem 0.75rem;
background: var(--bg-input);
border-radius: 4px;
margin-bottom: 0.5rem;
}
.process-item:hover {
background: var(--bg-hover);
}
.process-info {
flex: 1;
min-width: 0;
}
.process-name {
font-size: 0.8rem;
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.process-meta {
display: flex;
gap: 0.75rem;
font-size: 0.7rem;
color: var(--text-muted);
margin-top: 0.2rem;
}
.process-stat {
display: flex;
align-items: center;
gap: 0.25rem;
}
.process-stat.memory { color: var(--accent-hover); }
.process-stat.cpu { color: var(--green); }
.process-stat.children { color: var(--yellow); }
.process-actions {
display: flex;
gap: 0.25rem;
}
.process-mode {
font-size: 0.6rem;
padding: 2px 6px;
border-radius: 3px;
background: var(--bg-hover);
color: var(--text-muted);
text-transform: uppercase;
}
.process-mode.shell {
background: rgba(234, 179, 8, 0.2);
color: var(--yellow);
}
/* Responsive */
@media (max-width: 600px) {
.header-brand {