Commit graph

79 commits

Author SHA1 Message Date
Peter Steinberger
b22d8995dd
Add comprehensive server tests and switch to Biome linter (#73) 2025-06-24 18:51:38 +02:00
Mario Zechner
45f217e143 Improve latency of both process.stdout and asciinema stdout writes. 2025-06-24 17:47:16 +02:00
Mario Zechner
f339e69f9a Add terminal size reset feature and fix source maps (#72)
- Add POST /api/sessions/:sessionId/reset-size endpoint to reset terminal size when clients disconnect
- Implement reset-size control pipe command in PTY manager
- Update session-view component to call reset-size on unmount
- Add terminal resize event listener in fwd.ts to track terminal size changes
- Fix source maps configuration for development mode:
  - Set inline source maps with embedded sources in esbuild config
  - Add source map settings to TypeScript configs
  - Set NODE_ENV to development for dev builds

This ensures external terminals resize back to their actual size when the last web client disconnects.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-24 16:12:44 +02:00
Mario Zechner
d37f813b83 Fix alias resolution and improve cross-platform support
- Fixed alias regex to handle both 'alias name=value' and 'name=value' formats
- Added platform-specific shell execution with proper flags for Windows/Unix
- Skip alias resolution on Windows (not supported)
- Use expanded alias value instead of running the alias name
- PowerShell uses -NoProfile -Command, cmd.exe uses /C, Unix shells use -c/-i
2025-06-24 14:36:10 +02:00
Mario Zechner
1470da3129 Merge branch 'origin/exec-which' and simplify command resolution
- Unified all command resolution logic in ProcessUtils.resolveCommand()
- Simplified alias handling to use interactive shell execution
- Fixed alias execution by using 'zsh -i -c' for proper alias loading
- Removed duplicate resolution code from pty-manager
- Commands are now resolved in order: PATH -> aliases -> shell builtins
2025-06-24 14:13:09 +02:00
Mario Zechner
e6e3173244 NPM distribution prep work and minor fixes in session-view/fwd logging. 2025-06-24 13:36:42 +02:00
Peter Steinberger
ac57f77806 Revert "remove authToken; that would prevent localhost from entering pw-less"
This reverts commit f59147dbc1.
2025-06-24 09:37:02 +02:00
Peter Steinberger
cd33c8f378 Revert "bypass localhost / route"
This reverts commit ef9a757608.
2025-06-24 09:37:02 +02:00
Peter Steinberger
ef9a757608 bypass localhost / route 2025-06-24 03:46:24 +02:00
Mario Zechner
17cffe7424 Fix SSE stream closing (green cursor of death) 2025-06-24 03:45:25 +02:00
Peter Steinberger
f59147dbc1 remove authToken; that would prevent localhost from entering pw-less 2025-06-24 03:38:41 +02:00
Peter Steinberger
801438d867 Add local bypass feature 2025-06-24 03:26:04 +02:00
Peter Steinberger
5b7fdac0c2 Revert "really ensures terminals close even for claude"
This reverts commit fd0abeeeee.
2025-06-24 03:20:13 +02:00
Mario Zechner
10e4f97924 Fix auth logging, fix PAM native loading outside SEA builds 2025-06-24 02:10:15 +02:00
Peter Steinberger
4e1d3a9a98 Revert "log should also authenticate, no?"
This reverts commit 62c6052faf.
2025-06-24 02:09:29 +02:00
Mario Zechner
498eb4f3fc Unfuck tsconfigs + VS Code + eslint + tsc, fix type errors 2025-06-24 01:51:46 +02:00
Peter Steinberger
62c6052faf log should also authenticate, no? 2025-06-24 01:47:45 +02:00
Mario Zechner
73dd60870e Fix SEA build wrt PAM 2025-06-24 01:38:21 +02:00
Peter Steinberger
b363355543 recompile native authenticate_pam for custom node 2025-06-24 01:16:38 +02:00
Peter Steinberger
fd0abeeeee really ensures terminals close even for claude 2025-06-24 01:01:04 +02:00
Peter Steinberger
3d28de87c4 don't use interactive shells for commands, make terminal close 2025-06-24 01:01:04 +02:00
Mario Zechner
bb17f4adcd Async fsync, so writes from PTY to host terminal are fast again. 2025-06-24 00:52:45 +02:00
Helmut Januschka
e9b395b726
Implement comprehensive user authentication with SSH key management (#43)
* Implement comprehensive user authentication system

- Add SSH-first authentication with password fallback
- Implement JWT token-based session management (24h expiry)
- Create browser-based SSH agent with key storage and signing
- Add challenge-response SSH authentication protocol
- Integrate PAM for system password authentication
- Build comprehensive authentication UI components
- Add SSH key manager for key generation and management
- Update middleware to support JWT tokens alongside existing auth
- Maintain backwards compatibility with existing HQ/remote auth
2025-06-24 00:31:13 +02:00
Armin Ronacher
77dc0993c4 Try to detect what triggers the bell 2025-06-23 23:54:48 +02:00
Peter Steinberger
9dd5c2a3af server: small test fixes 2025-06-23 17:28:22 +02:00
Peter Steinberger
3351cc08c2 fixes linter issues 2025-06-23 16:55:53 +02:00
Peter Steinberger
9101613351 server: Allow empty username to restore b2 behaviour. Fixes #59 2025-06-23 16:55:26 +02:00
Peter Steinberger
ed9ea0e373 TS fixes 2025-06-23 15:28:20 +02:00
Peter Steinberger
03cb7b4774 fix remaining ts issues 2025-06-23 15:22:47 +02:00
Armin Ronacher
79b82e4977 Removed push notification banner 2025-06-23 15:07:49 +02:00
Peter Steinberger
c7e0675d5c Support bind for server 2025-06-23 14:58:11 +02:00
Armin Ronacher
4a3f7d4722 Better filtering for OSC bells 2025-06-23 14:12:46 +02:00
Armin Ronacher
0ac9f81b90 Added push notifications for bells 2025-06-23 13:51:49 +02:00
Armin Ronacher
cb9e7c640c Improve UI session names to use human-readable format
Replace ugly timestamp-based session names (session_1703123456789)
with human-readable format like "claude (~/Dev/vibetunnel/web)".

- Extract session naming logic into shared utility
- Update UI session creation to use same naming as CLI
- Consolidate abbreviatePath and generateSessionName functions
- Both CLI and UI sessions now use consistent readable names

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 09:52:47 +02:00
Armin Ronacher
3758e2d375 Allow navigating to arbitrary paths and make the location clickable in the browser 2025-06-23 09:30:30 +02:00
Mario Zechner
c07279a161 Fix Monaco editor diff view and improve file browser UI
- Fixed diff view highlighting by completely disabling workers
- Changed from ES modules to AMD loading for Monaco
- Extracted 356 lines of icon code to file-icons.ts utility
- Fixed git status detection with proper path handling
- Added recursive git changes view with flat listing
- Improved title bar with blue path color and better back button
- Made file browser fullscreen with mobile swipe support
- Moved git toggles to file list header to save space
- Made preview header responsive with 2-column grid on mobile
- Fixed server-side git show HEAD command with ./ prefix

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 05:56:58 +02:00
Mario Zechner
762ebc0196 feat: Replace CodeMirror with Monaco Editor
- Add Monaco Editor (v0.52.2) as dependency
- Create MonacoEditor Lit component with normal and diff modes
- Support inline/side-by-side diff switching with responsive behavior
- Replace CodeMirror in file browser with Monaco
- Add /api/fs/diff-content endpoint for fetching original/modified content
- Update build system to use esbuild with Monaco plugin
- Add proper Monaco asset handling and bundling
- Style Monaco with VibeTunnel dark theme

Note: There are rendering artifacts that need to be addressed

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 03:14:45 +02:00
Mario Zechner
402143716e Add shell alias support and improve debug logging
- Add automatic shell alias resolution via ProcessUtils.resolveCommand()
- Support aliases like 'claude-danger' by running through user's shell
- Detect user's shell properly on all platforms (zsh, bash, pwsh, cmd, etc.)
- Replace --debug CLI flag with VIBETUNNEL_DEBUG environment variable
- Update spec.md with new functionality

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 02:45:54 +02:00
Mario Zechner
30b67e8b66 Add alias resolution for executable path lookup
- When 'which' fails, now calls 'bash -i -c "alias"' to get all aliases
- Parses the alias output (key='value' format) into a Map
- Checks if the executable is an alias and resolves it
- Extracts the actual command from alias value (handles arguments)
- Attempts to resolve the aliased command to an absolute path

This allows using shell aliases like 'll' or custom aliases as commands.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 02:27:53 +02:00
Mario Zechner
eae2b03172 Also resolve aliases 2025-06-23 02:25:40 +02:00
Mario Zechner
571e8a1388 More logging 2025-06-23 02:22:13 +02:00
Mario Zechner
156f182ee5 Add executable path resolution to PTY manager
- Resolve command executables to absolute paths before spawning PTY
- Use 'which' command to find executables in PATH
- Handle absolute paths, relative paths, and PATH lookups
- Log the final resolved command for debugging
- Store resolved command in session info

This ensures consistent behavior regardless of how commands are specified
and helps with debugging by showing exact paths being executed.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 02:16:28 +02:00
Armin Ronacher
f25194d3c8 Fixed home path detection (hopefully) 2025-06-23 01:22:13 +02:00
Armin Ronacher
96460fa5e4 Fix path insert 2025-06-23 01:14:54 +02:00
Peter Steinberger
f2d89352f0 Some terminals like Warp start up slow, 5 sec is too strict 2025-06-23 00:18:37 +02:00
Mario Zechner
302063327e feat: Add unified logging infrastructure with web viewer
- Implement client-side logger that mirrors server interface
- Add /api/logs endpoints for client log submission and retrieval
- Create real-time log viewer component at /logs with filtering
- Update all client files to use new logging system
- Add responsive design for log viewer (mobile/desktop layouts)
- Implement smart auto-scroll that preserves reading position
- Add Mac-style auto-hiding scrollbars
- Configure Express to serve .html files with clean URLs
- Update spec.md with logging infrastructure documentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 00:05:43 +02:00
Mario Zechner
04cfe992ee refactor: Apply unified logging style guide to all server files
- Remove all colors from error/warn logs per style guide
- Add appropriate colors to logger.log calls (green=success, yellow=warning, blue=info, gray=metadata)
- Remove all prefixes like [STREAM], ERROR:, WARNING:
- Ensure all messages start lowercase (except acronyms) with no periods
- Add missing essential logs for lifecycle events and state changes
- Add debug logs for troubleshooting and performance monitoring
- Ensure all error logs include the error object
- Add proper logging to previously silent catch blocks
- Enhance context in logs with relevant IDs, counts, and durations

The logging now provides comprehensive visibility into:
- Server initialization and shutdown sequences
- Session lifecycle (creation, usage, termination)
- Connection events and client tracking
- Authentication attempts and security events
- File system operations and Git performance
- Remote server health checks and HQ communication
- Process management across platforms
- Resource cleanup and performance metrics

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 23:10:51 +02:00
Mario Zechner
f6df526f6b feat: Add structured logging system with unified style
- Implement centralized logger utility with file and console output
- Add debug mode support via --debug flag
- Initialize logger at startup for server, fwd, and cli
- Replace all console.log/error calls with structured logger
- Add logging style guide for consistent messaging
- Include proper shutdown handling with closeLogger()

The logger provides:
- Timestamped color-coded console output
- Module identification in all logs
- File logging to ~/.vibetunnel/log.txt
- Debug logs toggled via --debug flag

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 22:40:00 +02:00
Mario Zechner
3a3b5e44e9 feat: Add unified logger utility with file and console output
- Create logger factory with explicit module names (no stack traces)
- Support log/warn/error/debug levels with clean method names
- Write to ~/.vibetunnel/log.txt with automatic cleanup on startup
- Add colored console output with timestamps and module names
- Support debug mode via flag or environment variable

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 22:04:11 +02:00
Mario Zechner
1bb15097a4 refactor: Remove unused stream-notifier system
The direct notification system wasn't being used since hasListeners()
was checking before any listeners were set up. All sessions were using
file watching anyway. Simplified the code by removing the unused
notification system and keeping only the optimized file watching.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 21:09:57 +02:00