Commit graph

10 commits

Author SHA1 Message Date
Mario Zechner
52feefddf2 fix: Prevent duplicate notifications and improve latency
- Only use file watcher if no direct notifications are available
- Remove unnecessary deduplication logic
- Clean up logging for direct notifications
- Wait 100ms to detect if we're getting direct notifications before
  starting file watcher (for cross-process scenarios)

This should eliminate duplicate broadcasts and improve latency for
server-created sessions while maintaining compatibility with fwd.ts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 20:36:30 +02:00
Mario Zechner
fbc8954d39 feat: Optimize file watching for lower latency streaming
- Add platform-specific optimized file watcher
  - Linux: inotify with rapid polling after changes
  - macOS: FSEvents + periodic checks to overcome batching
  - Windows: ReadDirectoryChangesW with debouncing
- Add direct in-process notifications via StreamNotifier
  - Bypasses file watching for same-process sessions
  - Near-instant latency for server-created sessions
- Update StreamWatcher to use both mechanisms
  - Primary: Direct notifications (microsecond latency)
  - Fallback: Optimized file watching (for fwd.ts)
- Add latency and stress test scripts

This should significantly reduce streaming latency, especially
for sessions created by the server process.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 20:18:57 +02:00
Peter Steinberger
180caf7e81 Add logic to use custom node compiler 2025-06-22 11:53:15 +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
367d907ef1 We should never skip this 2025-06-22 01:13:16 +02:00
Peter Steinberger
5ee5cbb5ec Make scripts ugly but resilient 2025-06-21 18:08:00 +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
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
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
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