Commit graph

44 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
e6e3173244 NPM distribution prep work and minor fixes in session-view/fwd logging. 2025-06-24 13:36:42 +02:00
Mario Zechner
498eb4f3fc Unfuck tsconfigs + VS Code + eslint + tsc, fix type errors 2025-06-24 01:51:46 +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
Mario Zechner
7669d33d65 Fix tsconfig.json to include Node types, fix typecheck script to include server code checks (again ...) 2025-06-24 00:06:40 +02:00
Peter Steinberger
61b97ee234 fix ts dom issues 2025-06-23 15:18:45 +02:00
Armin Ronacher
0ac9f81b90 Added push notifications for bells 2025-06-23 13:51:49 +02:00
Mario Zechner
eb4f358fa2 Merge main into monaco branch 2025-06-23 05:59:04 +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
Peter Steinberger
685562112b lint 2025-06-23 03:01:10 +02:00
Mario Zechner
92b7819fc7 FIX SHIT 2025-06-23 01:33:32 +02:00
Peter Steinberger
44fb40bfc3 Move uuid from devDependencies to dependencies
The uuid package is used in runtime code (server.ts, hq-client.ts,
pty-manager.ts) so it needs to be in dependencies, not devDependencies.
This fixes the esbuild bundling errors during the build process.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 01:06:34 +02:00
Peter Steinberger
fe5f4eaa23 Fix build script to handle missing hash file gracefully
- Change error to warning when hash file is not found
- Force full rebuild instead of failing when hash is missing
- This fixes build failures when the hash calculation phase hasn't run

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 01:03:51 +02:00
Armin Ronacher
a8f96f8129 Replace monaco with codemirror for previews (works now) 2025-06-23 00:52:50 +02:00
Peter Steinberger
4876b472b5 fix: Use verbose test reporter in CI for better debugging
Added test:ci script with verbose reporter to help diagnose test
failures in CI environment. Also set CI environment variable.
2025-06-22 07:38:29 +02:00
Peter Steinberger
163e1b6f03 fix: Add CI-specific build script to skip native executable build
The Node.js CI build was failing because it tried to build the native
executable which requires postject and other tools that may not be
available in all CI environments. Created a separate build:ci script
that skips the native build step for CI.
2025-06-22 07:34:59 +02:00
Peter Steinberger
bef58a61d9 add postject 2025-06-22 01:13:23 +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
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
a2c9f0e0d8 downgrade chalk to make Xcode integration easier 2025-06-21 02:50:44 +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
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
Mario Zechner
6ae43fbde8 Fix cross-platform build issues in web package
Replace shell commands that fail on Windows with Node.js scripts:
- mkdir -p / cp -r → scripts/copy-assets.js
- rm -rf → scripts/clean.js
- Add scripts/ensure-dirs.js for directory creation

This resolves "A subdirectory or file -p already exists" errors
when running npm scripts on Windows with Git Bash.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 01:43:27 +02:00
Mario Zechner
4f837b729d Switch to @homebridge/node-pty-prebuilt-multiarch for better cross-platform support
- Replace @lydell/node-pty with @homebridge/node-pty-prebuilt-multiarch
- Update imports in PtyManager.ts
- Simplify auto-detection logic in PtyService.ts by removing explicit require check
- Improves reliability and cross-platform compatibility with prebuilt binaries

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 00:57:31 +02:00
Mario Zechner
abb652fec2 Implement comprehensive PTY service enhancements with proper async operations
## Major Features Implemented

### 🔄 Enhanced Process Termination
- Async kill operations with proper SIGTERM → SIGKILL escalation
- 3-second timeout with 500ms check intervals for graceful termination
- Process status monitoring using signal 0 checks
- Comprehensive logging of termination process

### 📊 Process State Detection
- Waiting state detection using `ps -p <pid> -o stat=` like tty-fwd
- Unix process state analysis (R=running, S/D/T=waiting, Z=zombie)
- Real-time status updates during session listing
- Automatic zombie process cleanup

### 🖥️ Improved UI Event Handling
- `session-killed` event dispatched AFTER successful termination
- Immediate UI feedback with session card removal
- `session-kill-error` event for failed operations
- Proper error handling and user notification

### 🔧 Node-pty Migration
- Switched from `node-pty` to `@lydell/node-pty` with prebuilt binaries
- Express downgraded from v5 to v4 for better compatibility
- Added `signal-exit` dependency for cleanup handlers
- Enhanced fallback mechanisms for both implementations

### 📡 API Enhancements
- Kill endpoint now waits for actual process termination
- New `/api/pty/status` endpoint for implementation monitoring
- Enhanced session metadata with waiting state
- Improved error responses with detailed messages

### 🎯 Key Technical Improvements
- Type-safe async operations throughout PTY stack
- Proper cleanup on process exit with signal handlers
- Compatible session file structure with tty-fwd
- Enhanced asciinema recording with UTF-8 handling

All changes maintain full backward compatibility while providing
significant improvements in reliability and user experience.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 00:57:31 +02:00
Mario Zechner
ee111b44a0 Update web client to handle new exit event format
- Remove automatic session snapshot loading on exit in session-view
- Update cast-converter to properly parse exit events in new format
- Handle exit events when timestamp field is "exit" string

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 23:45:36 +02:00
Peter Steinberger
2e8cfd0a7c web fu - sorry 2025-06-18 20:12:07 +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
d9d134ff2b Replace XTerm.js with headless terminal implementation
- Remove XTerm.js dependencies (@xterm/xterm, @xterm/addon-fit, @xterm/addon-web-links, asciinema-player)
- Switch terminal component to use @xterm/headless for better performance and compatibility
- Simplify build process by removing unused renderer and mobile-terminal components
- Update package.json scripts to use asset bundling approach
- Fix TypeScript imports and remove deprecated addons
- Streamline terminal implementation for improved reliability

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 12:48:24 +02:00
Mario Zechner
b4d63fc922 New terminal renderer WIP 2025-06-17 22:10:48 +02:00
Mario Zechner
113786a35b Add responsive mobile terminal component with viewport scaling
- Created ResponsiveTerminal Lit component with mobile touch scrolling
- Implements XTerm.js with custom scaling algorithm for different viewport sizes
- Added setViewportSize() method for testing content reflow without regeneration
- Fixed mobile viewport issues using 100dvh for proper height calculation
- Added debounced ResizeObserver to prevent resize loops
- Component uses Tailwind classes and aggressive XTerm CSS constraints
- Test page allows switching viewport dimensions to observe content reflow
- Touch handlers scoped only to terminal content, not affecting external UI

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 16:09:09 +02:00
Mario Zechner
c04cb26f4e Fix linter formatting issues
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 01:52:52 +02:00
Peter Steinberger
bb20c3a833 lint web 2025-06-17 01:03:37 +02:00
Mario Zechner
9bc6fcc4b1 Replace CDN imports with local bundle in all tests
- Create renderer-entry.ts to bundle both Renderer and XTermRenderer
- Add bundle:renderer script to generate public/bundle/renderer.js
- Update all test files to import from ../bundle/renderer.js
- Remove all unpkg/CDN XTerm.js script imports
- Tests now use bundled dependencies for faster loading

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 10:38:19 +02:00
Mario Zechner
43d406a84c Clean up build system and implement XTerm.js renderer
- Replace TypeScript compilation with esbuild bundling
- Organize all generated files in public/bundle/
- Remove PWA features and simplify index.html
- Add XTerm.js renderer with same API as custom renderer
- Create comprehensive test suite in public/tests/
- Update .gitignore to only track source files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 09:33:33 +02:00
Mario Zechner
33b1f89f12 Fix Tailwind CSS to use local installation via npx
- Update build:css script to use npx tailwindcss instead of global
- Update watch:css script to use npx tailwindcss instead of global
- Ensures consistent builds using project dependencies

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 07:59:58 +02:00
Mario Zechner
179d0db754 Clean up file naming by removing -new suffixes
- Renamed server-new.ts → server.ts
- Renamed app-new.ts → app.ts
- Renamed app-new-entry.ts → app-entry.ts
- Updated package.json scripts to remove all -new references
- Updated custom element name from vibetunnel-app-new to vibetunnel-app
- Updated index.html to reference cleaned up files
- Added CLAUDE.md with development notes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 04:55:18 +02:00
Mario Zechner
56edbebe4c Fix dev script to use server-new.ts
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 04:01:49 +02:00
Mario Zechner
2324be0706 Web WIP 2025-06-16 03:35:14 +02:00
Mario Zechner
6830517221 Add complete web frontend for terminal multiplexer
- Implement TypeScript/Express server with tty-fwd integration
- Add real-time terminal streaming via Server-Sent Events using tail -f
- Create asciinema player integration with dynamic resize support
- Implement global keyboard capture for full terminal interaction
- Add session management (create, list, kill) with proper cleanup
- Support instant playback of existing content + real-time new content
- Include directory browser for working directory selection
- Add hot reload development workflow with concurrent build processes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 00:29:33 +02:00