Commit graph

262 commits

Author SHA1 Message Date
Armin Ronacher
46805a971a Allow real terminal to resize 2025-06-22 15:07:25 +02:00
Mario Zechner
862fc86c72 fix: eliminate lag in forwarded sessions by forcing immediate disk sync
- Add fs.fsyncSync after each asciinema event write to trigger file watchers immediately
- Keep socket connections alive with setKeepAlive for better performance
- Add response flushing in SSE streams to prevent buffering
- Fix the ~100ms input lag that was affecting forwarded sessions vs server-created sessions

The lag was caused by buffered writes not immediately triggering file system watchers.
Forwarded sessions now feel as responsive as server-created sessions.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 14:56:40 +02:00
Peter Steinberger
8e527c3c97 improve custom node docs 2025-06-22 14:46:34 +02:00
Mario Zechner
b8405b1ff5 fix: remove debug logging from cli.ts
Remove verbose module loading debug logs that were cluttering the output
when running fwd command.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 14:21:34 +02:00
Mario Zechner
4a5052f425 refactor: improve PTY manager cleanup and fwd.ts architecture
- Remove global exit handlers from PTY manager, add clean shutdown() method
- Use file watching approach for control pipes on all platforms (no FIFO)
- Simplify fwd.ts - control pipe and stdin forwarding handled by PTY manager
- Add forwardToStdout and onExit options to createSession
- Add proper TypeScript types to PtySession interface (no more "as any")
- Clean up logging throughout, keep only essential messages
- Add colorful output with chalk for session start/end messages
- Fix hanging process issue by properly unreferencing file watchers
- Update spec.md to reflect architectural changes

This makes the shutdown process predictable and fixes the hanging echo command issue.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 14:16:06 +02:00
Peter Steinberger
7e69ea1409 Add comments for native version mismatch 2025-06-22 13:45:19 +02:00
Peter Steinberger
1d2d6cee3c bugfix: clean session was not working in all cases 2025-06-22 13:44:39 +02:00
Peter Steinberger
180caf7e81 Add logic to use custom node compiler 2025-06-22 11:53:15 +02:00
Peter Steinberger
dbe280a68e add custom node folder to ignore 2025-06-22 11:53:00 +02:00
Peter Steinberger
2206176429 fix: Fix Node.js test race condition in CI
Changed the test command from 'echo' to 'sh -c "echo...; sleep 2"'
to prevent the session from exiting immediately before input can be sent.
This fixes the timing issue that occurs on faster CI runners.
2025-06-22 08:13:38 +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
8145ccf14e fix server throwing when cleaning exited 2025-06-22 07:01:34 +02:00
Mario Zechner
e912b65c9e Fix Node.js detection in build-bun-executable.sh for Xcode builds
Add common Node.js installation paths to PATH including Homebrew, NVM, n, and MacPorts locations. This matches the approach used in build-web-frontend.sh and ensures the script can find Node.js when running in Xcode's restricted environment.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 04:04:52 +02:00
Peter Steinberger
bef58a61d9 add postject 2025-06-22 01:13:23 +02:00
Peter Steinberger
367d907ef1 We should never skip this 2025-06-22 01:13:16 +02:00
Mario Zechner
18a28992df Add comprehensive frontend component documentation
- Document all frontend components with JSDoc headers describing their purpose and events
- Add @fires and @listens tags for all component events with detailed parameter descriptions
- Update spec.md with complete Component Event Architecture section
- Add shared terminal-text-formatter.ts for consistent text formatting between client/server
- Implement event-driven activity detection replacing polling-based approach
- Add content-changed event to vibe-terminal-buffer for activity monitoring
- Remove ESC prompt detection in favor of general activity detection
- Add plain text endpoint with optional style formatting (/api/sessions/:id/text?styles)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 23:14:30 +02:00
Mario Zechner
908c2d0375 Fix help text flickering in session list
- Only show loading state on initial load, not on periodic refreshes
- Prevents "Loading sessions..." from briefly appearing every 3 seconds
- Help text now remains stable after first load

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 22:20:23 +02:00
Mario Zechner
212be407a2 Fix terminal spawn fallback for socket connection failures
- Move spawn_terminal logic after remote forwarding to properly handle remotes
- Add spawn_terminal parameter to remote forwarding requests
- Handle ECONNREFUSED when socket exists but no listener is active
- Gracefully fall back to normal PTY spawn in all failure cases

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 22:02:27 +02:00
Mario Zechner
f0fd625243 Update docs to reflect Node.js SEA instead of Bun
- Update spec.md build system section with Node.js SEA details
- Update README.md production build section to clarify SEA executable
- Both files now correctly reflect the transition from Bun to Node.js

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 21:49:12 +02:00
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