feat(utils): add MessagePack TypeScript implementation#2
Open
mkotelnikov wants to merge 1164 commits into
Open
feat(utils): add MessagePack TypeScript implementation#2mkotelnikov wants to merge 1164 commits into
mkotelnikov wants to merge 1164 commits into
Conversation
- Add vitest configuration and 46 model unit tests - Create comprehensive ARCHITECTURE.md documentation - Tests cover all 9 model classes with proper API usage - Document MVC pattern, context adapter, and user actions flow Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace private method call with createEmptyStore for receiving peers - Add ID mapping to track stored object IDs during sync - Map remote HEAD to actual stored commit ID when setting refs - Ensure views update after synchronization by preserving correct IDs This fixes issues where: - Peers without a local repo couldn't sync - Views (Repository, Commit History, Files) didn't update after sync - Object IDs computed by storeCommit differed from sender's IDs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add message queue to process sync messages sequentially. Previously, when multiple messages arrived rapidly, the data event callbacks would run concurrently, causing sync-complete to execute before all objects were stored. This resulted in refs being set correctly but the refresh failing to find the commits. Now messages are queued and processed one at a time, ensuring all objects are stored before sync-complete triggers the view refresh. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change the share URL from a code element to a clickable link that opens in a new window. Added link-specific styling with hover effects. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create new @aspect/transport-adapters package for storage and repository adapters - Move VcsRepositoryAccess, GitNativeRepositoryAccess, and StorageAdapter - Add ObjectGraphWalker and wire format utilities - Remove repository-access and storage-adapters modules from transport package - Rename transport-connection to port-transport-connection in peer module - Add git-request-parser to transport protocol - Update package dependencies and exports Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement MessagePort to GitBidirectionalStream bridge for P2P git transport. This enables git protocol communication over MessageChannel, WebRTC, WebSocket, or any MessagePortLike interface. Features: - createGitStreamFromPort() - Bridge MessagePortLike to GitBidirectionalStream - createGitStreamPair() - Create connected stream pair for testing - ACK-based backpressure via port-stream - Error handling and propagation - Graceful close with pending data drain Part of Epic: webrun-vcs-hq12 (P2P Transport Bridge) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement MessagePort to GitBidirectionalStream bridge for P2P git transport. This enables git protocol communication over MessageChannel, WebRTC, WebSocket, or any MessagePortLike interface. Features: - createGitStreamFromPort() - Bridge MessagePortLike to GitBidirectionalStream - createGitStreamPair() - Create connected stream pair for testing - ACK-based backpressure via port-stream - Error handling and propagation - Graceful close with pending data drain Part of Epic: webrun-vcs-hq12 (P2P Transport Bridge) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement client-side P2P git protocol operations: - fetchFromPeer() - Fetch objects from peer via git-upload-pack - pushToPeer() - Push objects to peer via git-receive-pack - Capability negotiation helpers - Progress callback support These functions use ClientProtocolSession to drive the git protocol over MessagePortLike connections for P2P communication. Part of Epic: webrun-vcs-4hsj (P2P Client Functions) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
End-to-end integration tests for P2P git transport: - Full fetch cycle with upload-pack handler - Empty repository handling - Up-to-date detection - Pack data reception - Push to empty repository - Multiple ref updates - Progress callbacks - Large number of refs - Special characters in ref names Part of Epic: webrun-vcs-lprt (P2P Integration Tests) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement two-way synchronization between P2P peers: - planBidirectionalSync() - Plan sync actions for refs - planSync() - Shorthand for planning - executeSyncPlan() - Execute planned sync operations - Conflict detection for divergent histories - Ancestry-based merge direction detection - Exclusion pattern support - Configurable conflict resolution (prefer-local/remote) Part of Epic: webrun-vcs-2x6l (Bidirectional Sync) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements complete P2P Git transport over MessagePort: - Epic 1: P2P Transport Bridge - createGitStreamFromPort() bridges MessagePortLike to GitBidirectionalStream - createGitStreamPair() for testing - AsyncQueue for push-based to pull-based bridging - Epic 2: P2P Client Functions - fetchFromPeer() implements git-upload-pack client - pushToPeer() implements git-receive-pack client - Capability negotiation and sideband support - Epic 3: P2P Integration Tests - End-to-end tests over MessageChannel - Mock repository implementation - Epic 4: Bidirectional Sync - planBidirectionalSync() for two-way sync planning - Conflict detection with ancestry checking - Configurable conflict resolution strategies - Epic 5: Error Recovery - PortDisconnectedError, PortTimeoutError, TransferAbortedError - withTimeout() and createIdleTimeout() utilities - createDisconnectMonitor() for disconnect detection - createTransferTracker() for partial transfer state - withRetry() with exponential backoff - wrapP2POperation() combining all error recovery features Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Restores P2P Git transport implementation that was accidentally removed. P2P Transport Features: - createGitStreamFromPort() bridges MessagePortLike to GitStream - fetchFromPeer() and pushToPeer() client operations - planBidirectionalSync() for two-way sync with conflict detection - Error recovery: timeouts, disconnect handling, retry logic Documentation: - Updated README with P2P transport section and examples - Added P2P-ARCHITECTURE.md with detailed architecture docs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a pure TypeScript implementation of the MessagePack serialization format. Features: - Encoder: pack JavaScript values to MessagePack binary format - Decoder: unpack MessagePack data to JavaScript values - Supports: nil, boolean, integers, floats, strings, binary, arrays, maps - UTF-8 string encoding/decoding - Configurable character set for decoding (UTF-8, ASCII, byte array) Based on: - MessagePack specification: https://github.com/msgpack/msgpack/blob/master/spec.md - Original JS implementation: https://github.com/cuzic/MessagePack-JS (MIT) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
References
Test plan
🤖 Generated with Claude Code