Commit graph

242 commits

Author SHA1 Message Date
Mario Zechner
5ede1a50e0 Clean-up cli.ts 2025-06-21 21:29:15 +02:00
Mario Zechner
c7153769a8 Bun deleted, Nodejs is new king. Xcode not yet updated. 2025-06-21 21:21:11 +02:00
Mario Zechner
8e62137820 Node SEA build WIP 2025-06-21 20:54:57 +02:00
Peter Steinberger
e82c633a9a make file browser work without session 2025-06-21 19:06:19 +02:00
Peter Steinberger
16bc60b379 style and fix file browser 2025-06-21 18:58:42 +02:00
Peter Steinberger
d820a4b147 handle session id passing + better error messages 2025-06-21 18:55:34 +02:00
Peter Steinberger
34fc38d13f aff fs route 2025-06-21 18:08:06 +02:00
Peter Steinberger
5ee5cbb5ec Make scripts ugly but resilient 2025-06-21 18:08:00 +02:00
Peter Steinberger
4083c8132a add missing message type in frontend 2025-06-21 17:16:21 +02:00
Mario Zechner
5e9efb496e Package lock update 2025-06-21 17:08:25 +02:00
Mario Zechner
5180298bb5 Clean up build system and remove unused dependencies
- Remove all Jest-related dependencies (using Vitest)
- Remove pre-commit hooks (husky, lint-staged) and related files
- Consolidate test configuration into single vitest.config.ts
- Fix build-native.js to use correct entry point (src/cli.ts)
- Add bun.lock to .gitignore (generated during native build)
- Update README.md with simplified, accurate documentation
- Make npm run build include native executable build
- Remove unused type declarations and test setup files

The build system is now minimal, clean, and consistent.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 17:04:52 +02:00
Mario Zechner
9f3fcb3bb8 Simplify and clean up build system
- Consolidate complex npm scripts into minimal, clear commands
- Remove confusing bundle:*, watch:*, ensure:dirs scripts
- Add format:check script for CI compatibility
- Add @types/mime-types dev dependency to fix TypeScript errors
- Scripts are now cross-platform using Node.js instead of shell commands

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 16:48:47 +02:00
Mario Zechner
d4b8748b22 Reorganize server structure for clarity
- Rename index.ts to cli.ts as single entry point
- Merge app.ts and shutdown-state.ts into server.ts
- Update all imports and references to use new structure
- Update e2e tests and dev script to spawn via cli.ts
- Remove execution code from server.ts (only cli.ts executes)
- Clean up tsconfig.client.json exclude path

This creates a cleaner separation where cli.ts is the only entry
point that decides whether to run server or forward mode.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 16:44:56 +02:00
Peter Steinberger
db8f4ffbeb Add first iteration of file browser 2025-06-21 16:11:35 +02:00
Mario Zechner
f1d295a13f CLAUDE.md clean-ups 2025-06-21 15:10:17 +02:00
Peter Steinberger
3820f98e22 add tutorial 2025-06-21 14:43:00 +02:00
Peter Steinberger
a5b0354139 Burn everything with fire that is not node or swift. 2025-06-21 14:39:44 +02:00
Helmut Januschka
0068868d1a fix watch:server script path
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 11:38:41 +02:00
Peter Steinberger
8616a655df fix bun startup 2025-06-21 10:02:37 +02:00
Peter Steinberger
a2c9f0e0d8 downgrade chalk to make Xcode integration easier 2025-06-21 02:50:44 +02:00
Peter Steinberger
6729013b00 create session sheet animation 2025-06-21 02:50:44 +02:00
Peter Steinberger
6ce1786c5c port changes from node 2025-06-21 02:49:38 +02:00
Mario Zechner
8d5fd5457c Bun native build, unified entry point for native build. 2025-06-21 01:33:22 +02:00
Mario Zechner
508313a9bd fix: update CSS watch path from src/input.css to src/client/styles.css
The CSS file was moved but the watch:css script wasn't updated, causing npm run dev to fail.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 23:56:15 +02:00
Mario Zechner
b1718c27fa fix: handle HQ mode shutdown gracefully to prevent e2e test errors
- Add global shutdown state tracking via shutdown-state.ts module
- Update refresh-sessions endpoint to return 503 during shutdown
- Skip HQ notifications in control-dir-watcher during shutdown
- Disable remote health checks during server shutdown
- Suppress expected connection errors when servers are shutting down

This prevents the flood of "Failed to refresh sessions" and "Failed to
notify HQ" errors that were appearing in the HQ e2e test logs when
servers were shutting down.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 23:56:15 +02:00
Mario Zechner
f86d089226 fix: improve terminal rendering for cursor, inverse video, and overline
- Fixed cursor rendering with inverse video by applying cursor styling
  after inverse processing to ensure it takes precedence
- Added missing overline attribute support (isOverline() → .overline class)
- Improved consistency by applying all persistent styles after inverse
  video processing, which clears and rebuilds the style string

This fixes multiple edge cases in terminal rendering including cursor
visibility in inverted text and proper text decoration support.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 22:56:11 +02:00
Mario Zechner
dc2e72e052 fix: handle inverse video rendering for nano's white bar
Fixed the terminal renderer to properly handle inverse video attributes
when no explicit colors are set. Nano's header bar uses SGR 7 (inverse)
without explicit foreground/background colors, which now correctly swaps
the default terminal colors (#e4e4e4 foreground, #0a0a0a background).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 22:50:27 +02:00
Mario Zechner
5593ee39ef refactor: modularize server architecture and consolidate codebase
- Restructure server code into modular architecture under src/server/
  - middleware/: Authentication handling
  - pty/: PTY management consolidation
  - routes/: API endpoint handlers
  - services/: Core services (terminal, HQ, streaming)
- Consolidate 20+ scattered files into organized modules
- Replace unit/integration tests with comprehensive E2E testing
- Add spec.md as codebase navigation guide
- Update build paths for new CSS location (styles.css)
- Add chalk dependency for improved terminal output
- Simplify server entry point to use modular loader
- Update CLAUDE.md with spec.md regeneration instructions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 22:44:40 +02:00
Peter Steinberger
cdee7999b3 show error messages longer 2025-06-20 20:16:00 +02:00
Peter Steinberger
d8dae14bde add view transition for terminal open 2025-06-20 20:15:53 +02:00
Peter Steinberger
6eeabf657e Better frontend error messages 2025-06-20 19:09:21 +02:00
Peter Steinberger
b669b63fc9 redesign new session dialog 2025-06-20 16:54:09 +02:00
Peter Steinberger
d6d3a8f570 design tweaks 2025-06-20 16:34:10 +02:00
Peter Steinberger
20395d6e09 fix: Fix CI test failures
- Fix hanging TestNewStdinWatcher by not calling Stop() without Start()
- Fix TestSession_Signal and TestSession_KillWithSignal by adding PID values
- Fix isProcessRunning to use syscall.Signal(0) instead of os.Signal(nil)
- Update websocket test to expect new 'Unknown WebSocket endpoint' error message
- Add timeout handling to websocket integration test
2025-06-20 16:21:27 +02:00
Peter Steinberger
ad60da3140 frontend design tweaks 2025-06-20 16:01:50 +02:00
Peter Steinberger
70f5bf2c18 linting and test fixes 2025-06-20 15:43:06 +02:00
Mario Zechner
8558c481a0 feat: implement distributed buffer aggregation for HQ mode
- Enhanced /buffers WebSocket endpoint to aggregate updates from all remotes
- Added remote WebSocket connection management with proper Bearer auth
- Implemented connection pooling and automatic reconnection
- Forward binary buffer messages transparently from remotes to clients
- Track subscriptions per remote and handle cleanup properly
- Support both local and remote sessions through unified interface

This enables real-time terminal viewing across distributed VibeTunnel instances.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 12:43:26 +02:00
Mario Zechner
96a5f1c3d8 docs: add comprehensive server specification
- Complete architectural overview of VibeTunnel server
- Detailed protocol specifications for all components
- Binary buffer encoding format documentation
- HQ mode distributed architecture details
- API endpoint reference with examples
- WebSocket protocol specifications
- File system structure and session storage format
- Implementation notes for cross-language compatibility

This specification enables implementing VibeTunnel servers in any language
while maintaining full compatibility with the protocol and architecture.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 12:20:21 +02:00
Mario Zechner
8b200d6f9b refactor: major HQ architecture improvements based on review
- Remove registration retry from HQClient, let caller handle retries
- Make HQClient destroy method async and await unregister
- Remove session ID namespacing - UUIDs are unique enough
- Add /api/health endpoint for cheaper health checks
- Remove unnecessary RemoteServer.status field
- Track sessions by remote using sessionIds Set
- Fix remote session creation to use remote's token (not HQ's auth)
- Update session proxy to lookup remote by session ID
- Make cleanup-exited work across all remotes
- Remove tty_fwd_path code - always use node-pty
- Fix duplicate HQ endpoints
- Improve health check to try /api/health first, fall back to /api/sessions
- Remove offline remotes automatically on failed health check

BREAKING CHANGES:
- HQClient.destroy() is now async
- RemoteServer no longer has status field
- Session IDs are no longer namespaced with remoteId prefix

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 12:16:43 +02:00
Mario Zechner
862947b744 feat: require unique --name parameter for remote servers
- Add mandatory --name parameter when using --hq-url
- Ensure remote server names are unique across the HQ
- Return 409 Conflict when duplicate name is registered
- Track remotes by both ID and name in RemoteRegistry
- Add /api/remotes endpoints for HQ mode
- Improve error messages for registration failures

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 11:42:08 +02:00
Mario Zechner
ccea6fba02 feat: implement proper authentication with username/password support
- Add VIBETUNNEL_USERNAME/PASSWORD env vars and --username/--password CLI args
- Separate local auth from HQ registration auth (--hq-username/--hq-password)
- Validate that both username and password are provided or neither
- Update authentication to use configured username instead of hardcoded 'admin'
- Fix type errors and lint issues

BREAKING CHANGE: Authentication now requires both username and password to be specified together

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 11:36:32 +02:00
Mario Zechner
8a11508d61 fix: correct HQ authentication flow
- Remote servers now accept both Basic Auth (for clients) and Bearer token (for HQ)
- Basic Auth now requires username 'admin' (not any username)
- Remote sends its token to HQ during registration for HQ to use
- HQ uses Bearer token when calling remote APIs (not Basic Auth)
- Remote uses HQ's Basic Auth when registering/unregistering with HQ
- WebSocket connections also support both auth methods
- Display token in console when running as remote for debugging

This creates proper separation:
- Clients authenticate with servers using Basic Auth
- Remotes authenticate with HQ using HQ's Basic Auth
- HQ authenticates with remotes using remote's Bearer token

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 11:25:58 +02:00
Mario Zechner
c9a08a415a refactor: simplify HQ architecture with active health checking
- Remove heartbeat mechanism from HQClient - now just registers and forgets
- Update RemoteRegistry to actively check remote health via GET /api/sessions
- Remove /api/remotes/:remoteId/heartbeat endpoint as it's no longer needed
- Pass password to RemoteRegistry for authenticated health checks
- Remote servers no longer need to maintain connection to HQ after registration
- HQ checks remote health every 15 seconds with 5 second timeout

This simplifies the architecture - remotes just tell HQ they exist, and HQ
is responsible for monitoring their health status.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 11:05:19 +02:00
Mario Zechner
42c1dff89a feat: implement HQ mode session aggregation and proxying
- Modify GET /api/sessions to aggregate sessions from all online remotes
- Add remoteId and remoteName fields to session responses
- Implement session ID namespacing (remoteId:sessionId) to prevent collisions
- Add remoteId parameter to POST /api/sessions for creating remote sessions
- Create proxy middleware for forwarding session operations to remote servers
- Apply proxy middleware to all session-specific endpoints
- Handle offline remotes gracefully with proper error responses

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 10:43:29 +02:00
Mario Zechner
8e9f2485d3 feat: implement basic HQ mode infrastructure
- Add --hq flag to enable HQ mode for centralized management
- Add --join-hq flag for remote servers to register with HQ
- Implement RemoteRegistry for managing remote server connections
- Add HQClient for remote servers to register and send heartbeats
- Add /api/remotes endpoints for registration, heartbeat, and listing
- Enforce HTTPS requirement for HQ URLs for security
- Add graceful shutdown handling for HQ components

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 10:39:21 +02:00
Helmut Januschka
85036ba74b
feat: add Hack Nerd Font Mono Bold for enhanced terminal typography (#30)
Added HackNerdFontMono-Bold.ttf to improve terminal font rendering
with better bold character support and enhanced readability.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-20 09:38:18 +02:00
Helmut Januschka
9792908fe1
Add terminal max width control and fix WebSocket panic (#29)
* feat: add terminal max width option

- Add terminal preferences manager for persistent settings storage
- Add maxCols property to terminal component with width constraint logic
- Add UI toggle button (∞/80) in session header for easy width control
- Default behavior unchanged: unlimited width (takes full container)
- Optional 80-column max width limit when enabled
- Preferences saved to localStorage and restored on page load
- Real-time updates without page refresh

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

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: enhance terminal width selector with common presets and custom input

- Add common terminal width presets: ∞, 80, 100, 120, 132, 160
- Add custom width input field (20-500 columns)
- Replace simple toggle with dropdown selector UI
- Include helpful descriptions for each preset
- Support keyboard shortcuts (Enter to submit, Escape to cancel)
- Add click-outside-to-close functionality
- Maintain all existing preferences persistence
- Show current width in button label and tooltip

Common widths:
- 80: Classic terminal
- 100: Modern standard
- 120: Wide terminal
- 132: Mainframe width
- 160: Ultra-wide
- Custom: User-defined (20-500)

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: prevent WebSocket send on closed channel panic

Added safeSend helper function with panic recovery to handle race conditions
when multiple goroutines access WebSocket channels. Replaces unsafe channel
sends with graceful error handling.

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

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-20 09:21:20 +02:00
Peter Steinberger
b228ffb64c Web design tweaks 2025-06-20 06:59:22 +02:00
Peter Steinberger
70312fda17 Remove Hummingbird 2025-06-20 06:59:17 +02:00
Peter Steinberger
d3f80986e3 feat: redesign frontend with modern dark theme and green accents
- Update color scheme to use dark backgrounds (#0a0a0a, #1a1a1a, #242424)
- Add vibrant green accent colors (#00ff88) with glow effects
- Update Tailwind configuration with new theme colors and utilities
- Add reusable CSS component classes (btn-primary, btn-secondary, btn-ghost, card, input-field)
- Replace inline styles across all components with theme classes
- Create new terminal icon component with glow effect
- Update app header with redesigned layout and session stats
- Update session cards with improved visual hierarchy
- Redesign session create form and file browser modals
- Update session view with consistent theme styling
- Apply theme to mobile controls and overlays
- Update all status indicators to use theme colors
- Add smooth transitions and hover effects throughout
2025-06-20 05:47:14 +02:00