Commit graph

486 commits

Author SHA1 Message Date
Peter Steinberger
2e8cfd0a7c web fu - sorry 2025-06-18 20:12:07 +02:00
Peter Steinberger
6188d0080b Swift test fixes 2025-06-18 20:11:57 +02:00
Peter Steinberger
a2d38edbe9 test compat 2025-06-18 20:11:51 +02:00
Peter Steinberger
5ba7858b01 wording 2025-06-18 20:11:43 +02:00
Peter Steinberger
447a43719d Fix debug pane restart button visibility and improve layout
- Always show restart button when in Rust server mode (previously was hidden when server was healthy)
- Move server mode selection above HTTP server status for better UX flow
- Users can now always manually restart the Rust server regardless of health status
2025-06-18 20:08:35 +02:00
Peter Steinberger
36c4f9066c Merge PR #7: Fix incorrect Rust server directory paths in README
The tty-fwd directory is at the root of the project, not under rust/
This PR corrects the build instructions to reflect the actual project structure.

Co-authored-by: nityeshaga <93742147+nityeshaga@users.noreply.github.com>
2025-06-18 20:00:30 +02:00
Peter Steinberger
48d028e466 Add PWA support with web app manifest
- Add apple-touch-icon.png (1024x1024) for iOS/Android home screen
- Add manifest.json for Progressive Web App support
- Update index.html with PWA meta tags and links
- Enable standalone display mode with VibeTunnel theme colors

This allows users to add VibeTunnel to their home screen on mobile devices
and have it function as a standalone app with proper icon and theming.
2025-06-18 19:53:03 +02:00
Peter Steinberger
4307899c2e fix: update tests for Express 5 compatibility and fix unit tests
- Fix unit tests
  - Update session validation to check for non-empty strings in commands
  - Fix session ID validation test data to use valid hex characters
  - Add mock implementations for UrlHighlighter and CastConverter
  - Fix HTML escaping in URL highlighter mock
  - Adjust timing precision test tolerance

- Fix integration test infrastructure
  - Replace deprecated done() callbacks with async/await in WebSocket tests
  - Add urlencoded middleware for Express 5 compatibility
  - Create test stream-out file for cast endpoint

- All unit tests (32) and critical tests (15) now pass
- Integration tests still need work to match actual tty-fwd behavior
2025-06-18 19:49:27 +02:00
Peter Steinberger
d99ef041f7 feat: add integration tests and fix compatibility issues
- Add comprehensive integration test suite for Node.js server
  - API endpoint tests for session lifecycle, I/O operations, file system
  - WebSocket connection tests for hot reload functionality
  - Server lifecycle tests for initialization and shutdown
  - Basic binary availability tests for tty-fwd

- Fix Rust code for nix 0.30 API changes
  - Update dup2 calls to use OwnedFd instead of raw file descriptors
  - Fix read calls to pass file descriptors directly instead of raw fd
  - Remove deprecated as_raw_fd() calls where not needed

- Reorganize test structure
  - Split tests into unit/ and integration/ directories
  - Add separate Vitest configuration for integration tests
  - Create test utilities and setup files for both test types
  - Add custom test matchers for session validation

- Update test coverage configuration
  - Configure separate coverage for unit and integration tests
  - Add proper test timeouts for long-running integration tests
  - Use fork pool for integration tests to avoid port conflicts
2025-06-18 19:39:42 +02:00
Peter Steinberger
a045faeea3 Remove UserInterfaceState.xcuserstate from tracking 2025-06-18 19:37:59 +02:00
Peter Steinberger
940ea236ba fix: update Rust code for nix 0.30 compatibility
- Update term_socket.rs and tty_spawn.rs to use new nix 0.30 API
- dup2() now requires OwnedFd references instead of raw file descriptors
- Add proper OwnedFd handling with std::mem::forget to prevent premature closing
- Ensure compatibility with updated nix crate API changes
2025-06-18 19:35:30 +02:00
blacksmith-sh[bot]
4fa31c1717
Migrate workflows to Blacksmith (#17)
Co-authored-by: blacksmith-sh[bot] <157653362+blacksmith-sh[bot]@users.noreply.github.com>
2025-06-18 19:35:22 +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
6946caf321 various test fixes 2025-06-18 19:29:03 +02:00
Peter Steinberger
fdb0f0e67f redesign debug settings 2025-06-18 19:29:03 +02:00
Peter Steinberger
4b4aa3eda9 Fix zero session bug 2025-06-18 19:29:03 +02:00
Peter Steinberger
cba14f2866 Add AppleScript entitlements to the project 2025-06-18 19:29:03 +02:00
Peter Steinberger
a8876e9c69 Add basic Swift tests 2025-06-18 19:29:03 +02:00
Peter Steinberger
0f8299c7a0 Automatically restart server 2025-06-18 19:29:03 +02:00
Peter Steinberger
fb1058b55c change button to restart server 2025-06-18 19:29:03 +02:00
Peter Steinberger
b650ff4de5 design 2025-06-18 19:29:03 +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
Peter Steinberger
ea517dbf49 ci: update Swift workflow to use Xcode 16.4
- Update DEVELOPER_DIR environment variable to Xcode 16.4
- Update xcode-select commands to use Xcode 16.4
- Keep using macos-15 runner which should have Xcode 16.4 available
2025-06-18 19:02:12 +02:00
Peter Steinberger
fbfc4c57dd Remove periodic permission status logging
- Removed info logs for Accessibility permission status checks
- Removed info logs for AppleScript permission status checks
- These were being logged repeatedly and cluttering the console
2025-06-18 16:56:01 +02:00
Peter Steinberger
b7db081148 Add NSImage resize extension for terminal icons in pickers
- Created NSImage+Resize extension with high-quality resizing
- Fixed terminal icon display in picker menus
- Updated SelectTerminalPageView and AdvancedSettingsView to use resized icons
- Icons now properly display at 16x16 in menu pickers
2025-06-18 16:54:07 +02:00
Peter Steinberger
5804790ae1 recover lost commits 2025-06-18 16:49:39 +02:00
Peter Steinberger
915d3e3eb1 Fix remaining formatting issue in term_socket.rs 2025-06-18 15:26:10 +02:00
Peter Steinberger
4a0121eabe Fix Rust formatting and clippy warnings
- Fix cargo fmt formatting issues
- Fix unused variable warnings by prefixing with underscore
- Fix if_not_else clippy warning
- Fix uninlined_format_args warnings
- Fix redundant closure warning
2025-06-18 15:24:17 +02:00
Mario Zechner
e3e92c646d Remove debug logging from PTY child process
Removed eprintln\! statements that were cluttering stdout during PTY session creation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 14:43:38 +02:00
Mario Zechner
3fdad988ff Fix zombie process detection and add PTY-specific cleanup
- Update is_pid_alive to detect zombie processes (status 'Z') as dead
- Add spawn_type field to distinguish PTY vs socket sessions
- Add reap_zombies function to clean up zombie children
- Only attempt zombie reaping for PTY sessions to avoid interfering with osascript processes
- Fix session cleanup to work properly with zombie processes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 14:29:48 +02:00
Peter Steinberger
ef19211451 Fix clippy uninlined_format_args warnings
- Update format strings to use inline variable syntax
- Fix Linux CI clippy warnings for newer clippy version
2025-06-18 14:27:24 +02:00
Peter Steinberger
4cbbdf29fc Fix TIOCSCTTY usage for cross-platform compatibility
- Use proper type casting for ioctl on both Linux and non-Linux platforms
- Separate platform-specific code blocks for clarity
- Fix potential clippy warnings on Linux CI
2025-06-18 14:25:18 +02:00
Peter Steinberger
5f067c7a80 Fix clippy warnings and format code
- Fix redundant closure warning in api_server.rs
- Add backticks to login_tty in documentation comments
- All clippy warnings resolved
2025-06-18 14:16:43 +02:00
Peter Steinberger
f0658bccd0 improve bits for linux 2025-06-18 14:14:57 +02:00
Peter Steinberger
b90986c354 remove macos stuff 2025-06-18 14:14:03 +02:00
Mario Zechner
8b3c913e17 Add client-side session death detection via reconnection tracking
- Track SSE reconnection attempts in session-view
- Mark sessions as exited after 3 failed reconnects within 5 seconds
- Disconnect stream and load final snapshot when giving up
- Provides fallback when server exit events aren't reliably sent
- Improves UX by stopping endless reconnection attempts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 14:03:11 +02:00
Mario Zechner
2ceff6955c Make session kill endpoint wait for process death
- DELETE endpoint now waits up to 3 seconds for process to actually die
- Polls every 100ms to confirm process termination after SIGKILL
- Returns different messages based on whether process confirmed dead
- Makes is_pid_alive function public for reuse
- Provides more reliable session killing with proper status updates

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 14:01:43 +02:00
Peter Steinberger
db4b60e5f7 Fix CI: Apply cargo fmt to latest changes 2025-06-18 13:54:22 +02:00
Mario Zechner
779f8f3360 Fix session kill and add PTY PID tracking
- Update session.json status to "exited" when killing sessions via DELETE endpoint
- Set exit_code to 9 (SIGKILL) when process is killed
- Handle already-dead sessions by ensuring they're marked as "exited"
- Add PID tracking to PTY sessions so they can be properly killed
- Add reconnection detection in session-view: mark sessions as exited after 3 failed reconnects within 5 seconds

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 13:52:40 +02:00
Mario Zechner
71a5937ea1 Fix session card kill button animation cleanup
- Move stopKillingAnimation() to finally block to ensure it always runs
- Prevents animation from getting stuck when kill operation fails
- Ensures proper cleanup regardless of success or error conditions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 13:32:16 +02:00
Mario Zechner
c8931d1e40 Fix PTY streaming race condition and add exit events
- Add 5-second timeout when waiting for PTY stream-out file creation
- This prevents indefinite hanging when PTY background thread fails
- Send proper exit events to streaming clients when PTY process terminates
- Exit event format matches web frontend expectations: ["exit", exitCode, sessionId]
- Ensures web UI can properly handle session termination for PTY fallback

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 13:31:09 +02:00
Peter Steinberger
ec0bbcfdf4 Fix CI: Resolve all Clippy warnings and improve code quality
- Fixed redundant continue statements in loops
- Replaced manual string prefix stripping with strip_prefix method
- Fixed wildcard pattern that covered other patterns
- Removed redundant clone and unnecessary return value
- Used format string interpolation for cleaner code
- Removed unused imports and variables
- All Clippy checks now pass with -D warnings
2025-06-18 13:13:12 +02:00
Mario Zechner
68dd22e183 Fix session-view navigation for PTY fallback sessions
Change API response message from 'Terminal spawned successfully' to
'Session created successfully' for PTY fallback sessions. This allows
the web frontend to properly navigate to session-view instead of
treating it as a terminal window spawn.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 13:08:37 +02:00
Peter Steinberger
9b3839e361 Fix CI: Apply final Rust formatting 2025-06-18 13:07:37 +02:00
Peter Steinberger
6f20d395f5 Fix CI: Apply Clippy fixes and remove redundant continue statements
- Applied automatic Clippy fixes for better code quality
- Removed redundant continue statements at the end of match arms
- Fixed unused variable warnings by prefixing with underscore
- Applied cargo fmt to ensure consistent formatting
2025-06-18 13:06:06 +02:00
Mario Zechner
dd31dfb9f4 Fix compiler warnings in term_socket.rs
- Remove unused FromRawFd import
- Prefix unused parameters with underscore

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 13:05:46 +02:00
Mario Zechner
45f627fddf Add signal handling to update session statuses on server shutdown
- Add setup_shutdown_handler() to catch SIGTERM and SIGINT signals
- Create update_all_sessions_to_exited() to mark running sessions as exited
- Update handle_pty_session() to mark sessions as exited when PTY closes naturally
- Integrate signal handling into main server startup for both scenarios
- Ensures session.json files accurately reflect process state after server shutdown
- Fixes issue where sessions remain "running" after server restart or normal exit

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 13:04:52 +02:00
Peter Steinberger
2f4ca27b03 Fix CI: Format Swift and Rust code
- Fixed Swift formatting issues in AppConstants.swift and VibeTunnelApp.swift
- Fixed Rust formatting in tty-fwd source files
- CI should now pass formatting checks
2025-06-18 13:02:31 +02:00
Peter Steinberger
25d5bc5232 Fix CI: Convert reusable workflows to use workflow_call trigger
- Changed swift.yml, rust.yml, and node.yml from direct triggers to workflow_call
- This fixes the workflow configuration error causing immediate CI failures
- Reusable workflows must use workflow_call when invoked by other workflows
2025-06-18 13:00:17 +02:00
Peter Steinberger
7947278fb2 Fix CI: Correct spawn_terminal to spawnTerminal for Swift naming conventions
- Fixed SwiftLint error by changing snake_case variable name to camelCase
- Added small corner radius to Create New Session modal
- Increased padding between KILL and CREATE buttons in header
2025-06-18 12:57:53 +02:00