Skip to content

Commit e5411eb

Browse files
committed
feat: phase 4B-1 process management dashboard
Add comprehensive process management system with configuration, auto-detection, and .env file support. ## Backend Changes - Add managed process configuration system with CRUD operations - Implement framework auto-detection for Next.js, React, Vite, Flask, FastAPI, Spring Boot - Add .env file parsing and auto-loading of environment variables - Create process controller for lifecycle management - Add PTY-based process spawning - Implement process status tracking and monitoring - Add external process monitoring for non-managed processes ## Frontend Changes - Create Process Manager view with configuration management - Add ProcessConfigModal with auto-detect and template support - Implement ProcessCard component with status indicators - Add framework detection UI with project picker for monorepos - Create process templates for common frameworks - Add StartProcessModal for quick process launching - Update ProcessDetail page to work with managed processes - Add log viewing infrastructure ## Features - Auto-detect projects and frameworks from directory - Parse and load .env files automatically - Process templates for quick setup - Start/stop/restart managed processes - View process status and logs - Monorepo support with multi-project detection - Health check URL configuration - Auto-start on app launch - Environment variable management ## Technical Details - Integrated PTY system for process I/O - Event-based process output streaming - Configuration persistence to filesystem - Process state synchronization - Framework confidence scoring - Package manager detection (npm, pnpm, yarn)
1 parent d8df8a7 commit e5411eb

52 files changed

Lines changed: 9456 additions & 141 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.internal/phase4/4A-1_PROCESS_LOG_VIEWER.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
**Sprint:** Phase 4A
44
**Duration:** 5 days
5-
**Status:** READY
6-
**Priority:** Critical
5+
**Status:** ✅ COMPLETED (Started 2025-10-24, Finished 2025-10-24)
6+
**Completion Notes:** Core functionality implemented including per-process CPU/memory monitoring, log viewing with search/filtering, and process management. Basic UI complete with modal viewer and integration into Dashboard.
7+
**Priority:** ⭐⭐⭐ Critical
78
**Dependencies:** Phase 3A-1 (Port Discovery - COMPLETED)
89

910
---
@@ -51,17 +52,18 @@ All research findings documented in `/Users/gdsks/G-Development/GLINR/GLINR/GLIN
5152

5253
### Success Criteria
5354

54-
- [ ] Process stdout/stderr captured in real-time (< 50ms latency)
55-
- [ ] Circular buffer maintains last 10k lines per process
56-
- [ ] Virtual scrolling handles 10k+ lines without lag
57-
- [ ] Search with regex support highlights matches
58-
- [ ] Auto-scroll "follow mode" toggle works smoothly
59-
- [ ] ANSI color codes rendered correctly
60-
- [ ] "View Logs" button integrated into Port Map
61-
- [ ] Log viewer opens in modal or side panel
62-
- [ ] Copy log selection to clipboard
63-
- [ ] Clear logs button resets buffer
64-
- [ ] WCAG 2.2 Level AA compliant
55+
- [x] Process stdout/stderr captured in real-time (< 50ms latency)
56+
- [x] Circular buffer maintains last 10k lines per process
57+
- [x] Virtual scrolling handles 10k+ lines without lag (using svelte-virtual-list-ce)
58+
- [x] Search with regex support highlights matches
59+
- [x] Auto-scroll "follow mode" toggle works smoothly
60+
- [ ] ANSI color codes rendered correctly (deferred to future phase)
61+
- [x] "View Logs" button integrated into Dashboard
62+
- [x] Log viewer opens in modal
63+
- [x] Copy log selection to clipboard
64+
- [x] Clear logs button resets buffer
65+
- [x] Per-process CPU and memory monitoring implemented
66+
- [ ] WCAG 2.2 Level AA compliant (partial - needs accessibility audit)
6567

6668
---
6769

.internal/phase4/4B-1_PROCESS_MANAGEMENT.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,41 @@ pub enum FrameworkType {
147147
}
148148
```
149149

150-
#### 3. Framework Auto-Detection
150+
#### 3. Git Repository & Project Discovery
151+
152+
```rust
153+
/// Browse for Git repositories (similar to GitHub Desktop)
154+
#[tauri::command]
155+
pub async fn browse_git_repositories(start_path: Option<String>) -> Result<Vec<GitRepository>, String>
156+
157+
/// Scan a directory for projects (supports monorepos)
158+
#[tauri::command]
159+
pub async fn scan_directory_for_projects(dir_path: String) -> Result<Vec<DetectedProject>, String>
160+
161+
#[derive(Serialize, Deserialize, Clone, Debug)]
162+
pub struct GitRepository {
163+
pub path: String,
164+
pub name: String,
165+
pub branch: String,
166+
pub is_dirty: bool,
167+
pub remote_url: Option<String>,
168+
}
169+
170+
#[derive(Serialize, Deserialize, Clone, Debug)]
171+
pub struct DetectedProject {
172+
pub path: String,
173+
pub name: String,
174+
pub framework_type: FrameworkType,
175+
pub confidence: f32,
176+
pub suggested_command: String,
177+
pub suggested_args: Vec<String>,
178+
pub suggested_port: Option<u16>,
179+
pub package_manager: Option<String>, // npm, pnpm, yarn, pip, gradle, maven
180+
pub detected_files: Vec<String>,
181+
}
182+
```
183+
184+
#### 4. Framework Auto-Detection
151185

152186
```rust
153187
/// Detect framework type from a directory
@@ -162,6 +196,7 @@ pub struct FrameworkDetection {
162196
pub suggested_command: String, // e.g., "npm"
163197
pub suggested_args: Vec<String>, // e.g., ["run", "dev"]
164198
pub suggested_port: Option<u16>, // e.g., 3000 for Next.js
199+
pub package_manager: Option<String>,
165200
}
166201
```
167202

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@
3131
"@xterm/addon-search": "^0.15.0",
3232
"@xterm/addon-web-links": "^0.11.0",
3333
"@xterm/xterm": "^5.5.0",
34+
"ansi-to-html": "^0.7.2",
3435
"lucide-svelte": "^0.546.0",
3536
"simple-icons": "^15.17.0",
3637
"svelte": "^5.41.1",
38+
"svelte-sonner": "^1.0.5",
3739
"svelte-virtual-list-ce": "3.1.0-beta.2",
3840
"tauri-pty": "^0.1.1",
3941
"uplot": "^1.6.32"

pnpm-lock.yaml

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
//! Commands for external process log monitoring.
2+
3+
use crate::core::ProcessAttachment;
4+
use crate::state::AppState;
5+
use tauri::{AppHandle, State};
6+
7+
/// Attach to an external process for log monitoring
8+
#[tauri::command]
9+
pub async fn attach_to_external_process(
10+
pid: u32,
11+
port: Option<u16>,
12+
state: State<'_, AppState>,
13+
) -> Result<ProcessAttachment, String> {
14+
let monitor = state.inner().external_process_monitor.lock().await;
15+
monitor
16+
.attach_to_process(pid, port)
17+
.await
18+
.map_err(|e| e.to_string())
19+
}
20+
21+
/// Tail a log file and stream lines to the frontend
22+
#[tauri::command]
23+
pub async fn tail_log_file(
24+
path: String,
25+
app: AppHandle,
26+
state: State<'_, AppState>,
27+
) -> Result<String, String> {
28+
let monitor = state.inner().external_process_monitor.lock().await;
29+
monitor
30+
.tail_log_file(path, app)
31+
.await
32+
.map_err(|e| e.to_string())
33+
}
34+
35+
/// Capture logs using dtrace (macOS only)
36+
#[cfg(target_os = "macos")]
37+
#[tauri::command]
38+
pub async fn capture_with_dtrace(
39+
pid: u32,
40+
app: AppHandle,
41+
state: State<'_, AppState>,
42+
) -> Result<String, String> {
43+
let monitor = state.inner().external_process_monitor.lock().await;
44+
monitor
45+
.capture_with_dtrace(pid, app)
46+
.await
47+
.map_err(|e| e.to_string())
48+
}
49+
50+
/// Detach from a log file or process
51+
#[tauri::command]
52+
pub async fn detach_external_logs(
53+
attachment_id: String,
54+
state: State<'_, AppState>,
55+
) -> Result<(), String> {
56+
let monitor = state.inner().external_process_monitor.lock().await;
57+
monitor
58+
.detach(&attachment_id)
59+
.await
60+
.map_err(|e| e.to_string())
61+
}

0 commit comments

Comments
 (0)