Commit graph

35 commits

Author SHA1 Message Date
Peter Steinberger
978205da76 Add resize feature to Rust server 2025-06-19 14:32:14 +02:00
Peter Steinberger
83a4bf0f75
fix: apply formatters to pass CI checks (#19) 2025-06-19 01:39:27 +02:00
Mario Zechner
8553de6ae3 Fix exit event format in terminal sessions
- Change exit event from nested JSON to direct array format: ["exit", exit_code, session_id]
- Add StreamEvent::Exit variant to handle exit events properly in parsing
- Add write_raw_json method to StreamWriter for direct JSON output

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 22:04:13 +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
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
db4b60e5f7 Fix CI: Apply cargo fmt to latest changes 2025-06-18 13:54:22 +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
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
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
Mario Zechner
18bb33c2ce Fix escape sequence corruption in asciinema cast output
Replace blind UTF-8 conversion with escape-sequence-aware processing:
- Add proper ANSI escape sequence parser (CSI, OSC, simple sequences)
- Buffer at escape sequence boundaries instead of arbitrary UTF-8 boundaries
- Preserve complete escape sequences as atomic units during conversion
- Only apply UTF-8 validation to text content between escape sequences
- Eliminates rendering artifacts in complex terminal applications like Claude

This maintains full JSON/asciinema compatibility while fixing the
fundamental issue where escape sequences were being corrupted by
UTF-8 validation during cast file generation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 08:23:09 +02:00
Armin Ronacher
e8b22949c8 Clean up parser 2025-06-17 20:16:28 +02:00
Armin Ronacher
78a5d1a77e Refactor thread spawning 2025-06-17 19:47:04 +02:00
Armin Ronacher
1b41fac4cf Cleanup reading of existing content 2025-06-17 18:43:22 +02:00
Armin Ronacher
19b545d8ba Simplify startup handling for the stream 2025-06-17 18:41:50 +02:00
Armin Ronacher
58932a535b Initial work for streaming refactor 2025-06-17 18:30:25 +02:00
Armin Ronacher
9e564fef00 Fixed unicode slicing 2025-06-17 13:28:58 +02:00
Armin Ronacher
11cc34d003 Refactor output writing 2025-06-17 13:02:17 +02:00
Armin Ronacher
eee8a65450 Improved vt command to allow finding the current session 2025-06-17 09:56:21 +02:00
Peter Steinberger
12cef6f5c8 lint Rust 2025-06-17 01:03:29 +02:00
Armin Ronacher
4f29fd899e Remove unused heuristics for now 2025-06-17 00:33:45 +02:00
Armin Ronacher
afa48c67d5 Change default term 2025-06-16 22:53:10 +02:00
Armin Ronacher
4cbbf2e457 Fixed header size reporting 2025-06-16 22:49:17 +02:00
Armin Ronacher
535887061a Refactor header writing 2025-06-16 22:26:26 +02:00
Armin Ronacher
3e3f81b892 Fix terminal handling 2025-06-16 17:35:00 +02:00
Armin Ronacher
63d57d6ab9 Refactor session listing 2025-06-16 03:32:23 +02:00
Armin Ronacher
a4560e0bed Updated heuristics to fix some issues 2025-06-16 03:32:23 +02:00
Armin Ronacher
a9d75c2f04 Initial notification channel support 2025-06-16 03:32:23 +02:00
Armin Ronacher
0032b3c7af Port to jiff 2025-06-16 00:28:29 +02:00
Armin Ronacher
3bf7ce2c25 Add timestamps to session info 2025-06-15 23:55:15 +02:00
Armin Ronacher
c3f5744494 Update session status 2025-06-15 22:17:38 +02:00
Armin Ronacher
506465ce04 Make the tty-fwd tool output asciinema streams 2025-06-15 21:44:19 +02:00
Armin Ronacher
397b5803ac Add the protocol definitions from asciinema 2025-06-15 21:34:32 +02:00
Armin Ronacher
e439e1dba9 Initial changes for tty forwarding 2025-06-15 21:30:57 +02:00