Commit graph

19 commits

Author SHA1 Message Date
Mario Zechner
6ae43fbde8 Fix cross-platform build issues in web package
Replace shell commands that fail on Windows with Node.js scripts:
- mkdir -p / cp -r → scripts/copy-assets.js
- rm -rf → scripts/clean.js
- Add scripts/ensure-dirs.js for directory creation

This resolves "A subdirectory or file -p already exists" errors
when running npm scripts on Windows with Git Bash.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 01:43:27 +02:00
Mario Zechner
4f837b729d Switch to @homebridge/node-pty-prebuilt-multiarch for better cross-platform support
- Replace @lydell/node-pty with @homebridge/node-pty-prebuilt-multiarch
- Update imports in PtyManager.ts
- Simplify auto-detection logic in PtyService.ts by removing explicit require check
- Improves reliability and cross-platform compatibility with prebuilt binaries

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 00:57:31 +02:00
Mario Zechner
abb652fec2 Implement comprehensive PTY service enhancements with proper async operations
## Major Features Implemented

### 🔄 Enhanced Process Termination
- Async kill operations with proper SIGTERM → SIGKILL escalation
- 3-second timeout with 500ms check intervals for graceful termination
- Process status monitoring using signal 0 checks
- Comprehensive logging of termination process

### 📊 Process State Detection
- Waiting state detection using `ps -p <pid> -o stat=` like tty-fwd
- Unix process state analysis (R=running, S/D/T=waiting, Z=zombie)
- Real-time status updates during session listing
- Automatic zombie process cleanup

### 🖥️ Improved UI Event Handling
- `session-killed` event dispatched AFTER successful termination
- Immediate UI feedback with session card removal
- `session-kill-error` event for failed operations
- Proper error handling and user notification

### 🔧 Node-pty Migration
- Switched from `node-pty` to `@lydell/node-pty` with prebuilt binaries
- Express downgraded from v5 to v4 for better compatibility
- Added `signal-exit` dependency for cleanup handlers
- Enhanced fallback mechanisms for both implementations

### 📡 API Enhancements
- Kill endpoint now waits for actual process termination
- New `/api/pty/status` endpoint for implementation monitoring
- Enhanced session metadata with waiting state
- Improved error responses with detailed messages

### 🎯 Key Technical Improvements
- Type-safe async operations throughout PTY stack
- Proper cleanup on process exit with signal handlers
- Compatible session file structure with tty-fwd
- Enhanced asciinema recording with UTF-8 handling

All changes maintain full backward compatibility while providing
significant improvements in reliability and user experience.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 00:57:31 +02:00
Mario Zechner
ee111b44a0 Update web client to handle new exit event format
- Remove automatic session snapshot loading on exit in session-view
- Update cast-converter to properly parse exit events in new format
- Handle exit events when timestamp field is "exit" string

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 23:45:36 +02:00
Peter Steinberger
2e8cfd0a7c web fu - sorry 2025-06-18 20:12:07 +02:00
Peter Steinberger
1ece7b2fd5 feat: add comprehensive unit tests for Rust server and update dependencies
- Add unit tests for protocol.rs (24 tests)
  - SessionInfo serialization/deserialization
  - AsciinemaHeader and event handling
  - StreamWriter UTF-8 and escape sequence processing

- Add unit tests for sessions.rs (23 tests)
  - Session listing and management
  - PID tracking and process lifecycle
  - Signal handling and cleanup operations
  - Named pipe operations with timeout protection

- Add unit tests for api_server.rs (12 tests)
  - API response serialization
  - MIME type detection
  - File operations and path resolution

- Add unit tests for http_server.rs (12 tests)
  - HTTP request parsing and response generation
  - Server-Sent Events (SSE) handling
  - Edge cases for malformed requests

- Update Rust dependencies
  - jiff: 0.1 -> 0.2
  - nix: 0.29.0 -> 0.30.1
  - Update term_socket.rs for nix 0.30 API changes

- Update npm dependencies
  - Express: ^4.18.2 -> ^5.1.0
  - Various dev dependencies updated

Test coverage: 24.22% overall (489/2019 lines)
- http_server.rs: 82.65% coverage
- sessions.rs: 76.88% coverage
- api_server.rs: 26.55% coverage
- protocol.rs: 5.48% coverage
2025-06-18 19:32:39 +02:00
Peter Steinberger
6a8f472832 feat: adopt Blacksmith CI runners and comprehensive updates
- Migrate GitHub Actions to Blacksmith runners for faster CI
  - Update ubuntu-latest to blacksmith-4vcpu-ubuntu-2404
  - Update actions/setup-node@v4 to useblacksmith/setup-node@v5
  - Update Swatinem/rust-cache@v2 to useblacksmith/rust-cache@v3

- Fix all linting warnings across all platforms
  - TypeScript: Fix any type warnings with proper type annotations
  - Rust: All clippy warnings resolved
  - Swift: Fix SwiftLint violations and format code

- Update all dependencies to latest versions
  - npm: Major updates including Express 5 compatibility fixes
  - Rust: Update 7 crates to latest compatible versions
  - Swift: Dependencies already up-to-date

- Add comprehensive test suite using Vitest
  - API endpoint tests for session CRUD operations
  - WebSocket connection and streaming tests
  - Session management lifecycle tests
  - Frontend component tests (terminal, session-list)
  - Critical functionality tests covering core features
  - Test infrastructure with proper mocking and utilities

- All tests passing, ready for production use
2025-06-18 19:10:03 +02:00
Mario Zechner
d9d134ff2b Replace XTerm.js with headless terminal implementation
- Remove XTerm.js dependencies (@xterm/xterm, @xterm/addon-fit, @xterm/addon-web-links, asciinema-player)
- Switch terminal component to use @xterm/headless for better performance and compatibility
- Simplify build process by removing unused renderer and mobile-terminal components
- Update package.json scripts to use asset bundling approach
- Fix TypeScript imports and remove deprecated addons
- Streamline terminal implementation for improved reliability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 12:48:24 +02:00
Mario Zechner
b4d63fc922 New terminal renderer WIP 2025-06-17 22:10:48 +02:00
Mario Zechner
113786a35b Add responsive mobile terminal component with viewport scaling
- Created ResponsiveTerminal Lit component with mobile touch scrolling
- Implements XTerm.js with custom scaling algorithm for different viewport sizes
- Added setViewportSize() method for testing content reflow without regeneration
- Fixed mobile viewport issues using 100dvh for proper height calculation
- Added debounced ResizeObserver to prevent resize loops
- Component uses Tailwind classes and aggressive XTerm CSS constraints
- Test page allows switching viewport dimensions to observe content reflow
- Touch handlers scoped only to terminal content, not affecting external UI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 16:09:09 +02:00
Mario Zechner
c04cb26f4e Fix linter formatting issues
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 01:52:52 +02:00
Peter Steinberger
bb20c3a833 lint web 2025-06-17 01:03:37 +02:00
Mario Zechner
9bc6fcc4b1 Replace CDN imports with local bundle in all tests
- Create renderer-entry.ts to bundle both Renderer and XTermRenderer
- Add bundle:renderer script to generate public/bundle/renderer.js
- Update all test files to import from ../bundle/renderer.js
- Remove all unpkg/CDN XTerm.js script imports
- Tests now use bundled dependencies for faster loading

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 10:38:19 +02:00
Mario Zechner
43d406a84c Clean up build system and implement XTerm.js renderer
- Replace TypeScript compilation with esbuild bundling
- Organize all generated files in public/bundle/
- Remove PWA features and simplify index.html
- Add XTerm.js renderer with same API as custom renderer
- Create comprehensive test suite in public/tests/
- Update .gitignore to only track source files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 09:33:33 +02:00
Mario Zechner
33b1f89f12 Fix Tailwind CSS to use local installation via npx
- Update build:css script to use npx tailwindcss instead of global
- Update watch:css script to use npx tailwindcss instead of global
- Ensures consistent builds using project dependencies

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 07:59:58 +02:00
Mario Zechner
179d0db754 Clean up file naming by removing -new suffixes
- Renamed server-new.ts → server.ts
- Renamed app-new.ts → app.ts
- Renamed app-new-entry.ts → app-entry.ts
- Updated package.json scripts to remove all -new references
- Updated custom element name from vibetunnel-app-new to vibetunnel-app
- Updated index.html to reference cleaned up files
- Added CLAUDE.md with development notes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 04:55:18 +02:00
Mario Zechner
56edbebe4c Fix dev script to use server-new.ts
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 04:01:49 +02:00
Mario Zechner
2324be0706 Web WIP 2025-06-16 03:35:14 +02:00
Mario Zechner
6830517221 Add complete web frontend for terminal multiplexer
- Implement TypeScript/Express server with tty-fwd integration
- Add real-time terminal streaming via Server-Sent Events using tail -f
- Create asciinema player integration with dynamic resize support
- Implement global keyboard capture for full terminal interaction
- Add session management (create, list, kill) with proper cleanup
- Support instant playback of existing content + real-time new content
- Include directory browser for working directory selection
- Add hot reload development workflow with concurrent build processes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 00:29:33 +02:00