Commit graph

654 commits

Author SHA1 Message Date
Peter Steinberger
bb23cbcc32 feat(ios): Make 'claude' the default command in session creation
- Add 'claude' as the first quick start command
- Set 'claude' as the default command instead of 'zsh'
- Add sparkle icon for Claude command
- Remove 'irb' to make room for Claude in the grid
2025-06-20 05:45:48 +02:00
Peter Steinberger
ed14aee481 fix(ios): Update Connect button to use dark background with accent border
- Change from bright accent fill to dark terminal background
- Add accent color border that gets thicker when active
- Use accent color for text instead of terminal foreground
- Better visual consistency with the dark terminal aesthetic
2025-06-20 05:45:48 +02:00
Peter Steinberger
22b946d76c feat(ios): Add file browser and modernize Xcode project structure
- Implement beautiful file browser matching web frontend design
  - Directory navigation with parent directory support
  - Create folder functionality
  - File/folder icons and visual distinction
  - Loading states and error handling
  - Smooth animations and haptic feedback

- Update Xcode project to use folder synchronization (objectVersion 77)
  - Automatic file inclusion from filesystem
  - No manual file management needed in Xcode
  - Matches vibetunnel3 project structure

- Add file system API integration
  - Browse directory endpoint
  - Create directory endpoint
  - FileEntry model for API responses

- Integrate file browser with session creation
  - Browse button in working directory field
  - Sheet presentation of file browser
  - Default to home directory (~)

- Improve session creation UI
  - Transparent navigation bar with blur effect
  - Better spacing and visual hierarchy
  - Enhanced error display styling
  - Convert directory buttons to horizontal scroll
2025-06-20 05:45:48 +02:00
Peter Steinberger
8ddde1d6c2 feat(ios): Fix iOS build and integrate SwiftTerm for terminal emulation
Major improvements to the iOS VibeTunnel app:

SwiftTerm Integration:
- Properly integrated SwiftTerm 1.2.5 for terminal emulation
- Fixed naming conflicts and API compatibility issues
- Added proper actor isolation with @preconcurrency
- Terminal data now feeds correctly via SSE streams

Session Management:
- Fixed session model to match Go server's JSON response format
- Added CodingKeys mapping for field name differences (cmdline, cwd, etc.)
- Support for "starting" session status
- Enhanced date parsing for both ISO8601 and RFC3339 formats

Working Directory Fixes:
- Changed default working directory from iOS sandbox to server paths
- Now uses ~/ as default (matching web frontend)
- Added common server directories as quick options
- Server expands ~ to actual home directory

Terminal Streaming:
- Implemented Asciinema cast v2 format parsing
- SSE client properly handles output, resize, and exit events
- Added terminal snapshot loading for existing sessions
- Fixed special key handling with proper ANSI escape sequences

UI Improvements:
- Updated session list to grid layout (2 columns)
- Added session count and "Kill All" functionality
- Redesigned session cards with inline kill/clean buttons
- Shows command and working directory in session preview

Error Handling:
- Added comprehensive logging for debugging
- Enhanced error messages for better user experience
- Detailed API request/response logging
- Network error descriptions (connection refused, timeout, etc.)

Server Configuration:
- Set default server address to 127.0.0.1:4020
- Sessions now created with spawn_terminal: false for PTY mode
- Both web and iOS clients can share terminal sessions

The iOS app now provides a full terminal experience using SwiftTerm,
mirroring the web frontend's functionality with proper server integration.
2025-06-20 05:45:48 +02:00
Peter Steinberger
d68d5e5dae feat: Add Xcode project and asset catalogs
- Add xcodegen project specification (project.yml)
- Configure for iOS 18.0+ deployment target
- Add SwiftTerm package dependency
- Create asset catalogs:
  - App icon placeholder
  - Accent color (terminal blue)
  - Terminal background color
- Configure proper Info.plist settings
- Set up build configurations and schemes

The project is now ready to open in Xcode.
2025-06-20 05:45:48 +02:00
Peter Steinberger
e69dbda538 feat: Add complete native iOS/iPadOS app for VibeTunnel
- Beautiful terminal-inspired UI design with custom theme
- Full SwiftUI implementation targeting iOS 18+
- SwiftTerm integration for terminal emulation
- Real-time session management with SSE streaming
- Complete feature parity with web frontend:
  - Server connection management
  - Session list with auto-refresh
  - Create, kill, and cleanup sessions
  - Full terminal emulation with input/output
  - Keyboard toolbar with special keys
  - Font size adjustment
  - Haptic feedback throughout
- Comprehensive error handling and loading states
- iPad optimizations (basic, split view pending)
- Complete documentation and setup instructions

The app provides a native, performant alternative to the web interface
with a stunning dark theme and smooth animations.
2025-06-20 05:45:48 +02:00
Peter Steinberger
58fdc049ba copy more rust behavior, fix vt forwarder format 2025-06-20 05:30:13 +02:00
Peter Steinberger
710747ac8d settings cleanup 2025-06-20 05:30:13 +02:00
Mario Zechner
de8952d34a feat: highlight session cards with orange border when 'esc to interrupt' is detected
- Add checkForEscPrompt() method to scan buffer content on each update
- Emit 'esc-prompt-change' event when prompt presence changes
- Apply orange border to session card when prompt is detected
- Case-insensitive search for 'esc to interrupt' text

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 05:07:56 +02:00
Mario Zechner
3ec549344b fix: improve terminal buffer fitting algorithm
- Properly measure character width at 14px and scale proportionally
- Calculate visible rows based on container height
- Show bottom N lines that fit in the viewport
- Remove overly conservative character width estimates

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 04:54:06 +02:00
Mario Zechner
89982e9bdf feat: implement WebSocket-based real-time buffer updates
- Add /buffers WebSocket endpoint with binary protocol
- Replace polling with push-based updates in vibe-terminal-buffer
- Add buffer change notifications to TerminalManager
- Remove pollInterval property from components
- Optimize network traffic by only sending updates on changes

Binary protocol: [0xBF magic][4 bytes: session ID length][session ID][buffer data]

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 04:36:23 +02:00
Peter Steinberger
4327ac9349 settings tweaks 2025-06-20 04:14:46 +02:00
Peter Steinberger
a3f55affc6 check vt version 2025-06-20 04:08:02 +02:00
Peter Steinberger
73b8d899e0 better server switch animation 2025-06-20 04:08:02 +02:00
Peter Steinberger
b5989d0196 Allow cli reinstall 2025-06-20 04:08:02 +02:00
Peter Steinberger
ec5402b86e add connection timeout 2025-06-20 04:08:02 +02:00
Peter Steinberger
d09b7e7495 rename var 2025-06-20 04:08:02 +02:00
Peter Steinberger
c9b86bc9cf check if process is alve 2025-06-20 04:08:02 +02:00
Peter Steinberger
d99553c07d better logic for vt 2025-06-20 04:08:02 +02:00
Peter Steinberger
ca88128ff6 reap zombies 2025-06-20 04:08:02 +02:00
Peter Steinberger
0d825f9333 more id fixes 2025-06-20 04:08:02 +02:00
Peter Steinberger
9bcbb0c1f7 another go binary ignored 2025-06-20 04:08:02 +02:00
Peter Steinberger
3bc0b9445f fix log id 2025-06-20 04:08:02 +02:00
Peter Steinberger
93c9c19e7a ensure go is not checked in 2025-06-20 04:08:02 +02:00
Peter Steinberger
8180586f2d terminal spawning, get rid of debug logs 2025-06-20 04:08:02 +02:00
Peter Steinberger
fc6c9d74f1 fix terminal spawning 2025-06-20 04:08:02 +02:00
Peter Steinberger
ec8d3d1db9 Fancy about 2025-06-20 04:08:02 +02:00
Mario Zechner
deb3935172 Implement optimized binary format for terminal buffer transmission
- Switch from JSON to binary format for buffer data transfer
- Optimize encoding with run-length encoding for empty rows
- Reduce data size with efficient cell encoding (1 byte for spaces, variable for complex cells)
- Support both palette and RGB colors with minimal overhead
- Pre-calculate exact buffer sizes to avoid allocations

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:56:00 +02:00
Mario Zechner
35755d8376 fix: remove debug logging from vibe-terminal-buffer
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:49:02 +02:00
Mario Zechner
faba4b1407 refactor: simplify vibe-terminal-buffer to always fit horizontally
- Remove fontSize and fitHorizontally properties as they're no longer needed
- Always auto-scale font size to fit terminal width in container
- Simplify dimension calculation logic
- Remove unused props from session-card component
- Maintain bottom-aligned terminal view with proper scaling

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:48:08 +02:00
Mario Zechner
dbbaaa8442 fix: remove viewportY=0 to show bottom portion of terminal
- Let server decide which portion of buffer to return
- Server defaults to showing bottom portion with prompt
- Only request the number of lines that fit in viewport

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:25:50 +02:00
Mario Zechner
fb7d1b2dc0 feat: ensure last non-empty line is always visible in terminal buffer
- Show bottom portion of buffer when content exceeds viewport
- Keep all content visible when it fits within viewport
- Maintain fitHorizontally mode to show all content scaled
- Calculate proper start index to show the most relevant content

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:24:25 +02:00
Mario Zechner
6479168ca5 fix: change terminal buffer background to black
- Replace dark gray (#1e1e1e) with pure black background
- Match the expected terminal appearance

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:21:47 +02:00
Mario Zechner
3bf543e694 fix: resolve terminal rendering issues in vibe-terminal-buffer
- Move terminal color definitions to shared CSS in input.css
- Use bright color palette for dark backgrounds
- Switch from Lit template rendering to direct innerHTML for terminal content
- Add display: inline-block to terminal-char for proper rendering
- Remove redundant style definitions from terminal.ts
- Fix issue where Lit's template system was interfering with terminal output

The key fix was using innerHTML directly instead of Lit's template system for
the terminal content, matching the approach used in terminal.ts.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:21:16 +02:00
Mario Zechner
01df54c63b fix: add terminal styles to vibe-terminal-buffer component
- Add explicit terminal character styles to ensure proper rendering
- Include style definitions for bold, italic, underline, dim, strikethrough
- Ensure CSS variables are properly inherited from parent scope
- Fix text rendering issues where colors appeared gray

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 02:58:44 +02:00
Mario Zechner
c738ec0f57 feat: trim blank cells from end of each line
- Reduce data transfer by omitting trailing blank cells
- Keep at least one cell per line to maintain structure
- Handle empty lines efficiently with single space cell
- Add fallback rendering for completely empty lines

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 02:47:14 +02:00
Mario Zechner
4a9ee48427 feat: implement fitHorizontally mode and buffer trimming
- Add fitHorizontally mode to vibe-terminal-buffer component
- Scale font size to fit entire terminal width when enabled
- Trim blank lines from bottom of buffer to reduce data transfer
- Always show content from top down (not centered on cursor)
- Match behavior of terminal.ts fitTerminal implementation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 02:45:13 +02:00
Mario Zechner
aa0658acc7 Fetch at least one full terminal screen in buffer component
The component was only fetching as many lines as could fit in its container,
which could miss important context. Now it fetches at least one full terminal
screen worth of lines (stats.rows) to ensure we capture the complete visible
terminal state.

Also improved rendering to show the bottom portion when we have more lines
than can fit in the display area.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 02:33:23 +02:00
Mario Zechner
ef7a679c2b Fix binary buffer encoding to support large terminals
The binary encoding was using 16-bit unsigned integers which failed when:
- Terminal has many rows (>65k)
- Cursor is above the viewport (negative relative position)

Changes:
- Upgrade to version 2 of the binary format
- Use 32-bit integers for dimensions and positions
- Use signed integers for viewport/cursor positions
- Update header size from 16 to 32 bytes
- Update documentation to reflect new format

This fixes the issue where cursorY could be negative when the cursor
is above the visible viewport (e.g., cursorY=0, viewportY=46 results
in relative cursorY=-46).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 02:31:15 +02:00
Mario Zechner
b041743287 Add vibe-terminal-buffer component for efficient session previews
Replace terminal.ts in session-card with new buffer-based component that:
- Fetches terminal buffer snapshots via JSON API
- Polls every second only when content changes (checks lastModified)
- Automatically calculates lines needed based on container height
- Reuses terminal rendering styles and logic

Changes:
- Create terminal-renderer.ts with shared rendering logic for both components
- Add vibe-terminal-buffer component that works with buffer API
- Update session-card to use vibe-terminal-buffer instead of vibe-terminal
- Add terminal-line CSS for proper styling
- Fix color handling in terminal-manager (-1 means default color)
- Add debug logging to help diagnose rendering issues

The new approach is more efficient - no cast file parsing, just direct
buffer snapshots from the server.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 02:19:09 +02:00
Mario Zechner
00602e3218 Implement server-side terminal buffer management with xterm.js headless
Major architectural change: replaced tail -f streaming with direct file watching
and server-side terminal state management for better performance and efficiency.

Key changes:
- Add StreamWatcher class using fs.watch() instead of tail -f process
  - Benchmarks showed fs.watch() is faster and more efficient
  - Handles multiple SSE clients per session without duplicate processes
  - Streams existing content then watches for new data

- Add TerminalManager class for server-side xterm.js instances
  - Maintains headless terminal state per session
  - Watches stream files and feeds data into terminals
  - Provides binary buffer snapshots on demand

- Add new /api/sessions/{id}/buffer endpoint
  - Returns efficient binary terminal buffer snapshots
  - Supports viewportY and lines parameters for partial updates
  - Uses run-length encoding for compression

- Create comprehensive binary format documentation (snapshot-format.md)
  - 16-byte header with dimensions and cursor position
  - Variable-length cell encoding with UTF-8 and RGB support
  - ~75% size reduction compared to JSON

- Fix cmdline.join() error with defensive programming
  - Handle cases where cmdline might not be an array

This enables session-list.ts to efficiently show terminal states without
overwhelming client/server resources.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 01:56:20 +02:00
Peter Steinberger
938682cc85 Make go serve via mac 2025-06-20 01:51:36 +02:00
Peter Steinberger
009763b022 delete applescript go abomination 2025-06-20 01:07:57 +02:00
Peter Steinberger
b968bf7f1e Reasons 2025-06-20 01:07:57 +02:00
Mario Zechner
d5f54ddb57 Ignore Go executables. 2025-06-20 01:06:28 +02:00
Peter Steinberger
943410fc1c Add new vt binary that supports both rust and go 2025-06-20 00:48:33 +02:00
Peter Steinberger
ae270d66f8 Add support to detect new vt command 2025-06-20 00:37:09 +02:00
Peter Steinberger
788269c2ab Better gentle Sparkle update driver 2025-06-20 00:29:00 +02:00
Peter Steinberger
11911ebc8f add force kill buttom and Sparkle user driver 2025-06-19 23:53:12 +02:00
Peter Steinberger
d20b7e6656 Add manual kill button 2025-06-19 23:52:23 +02:00