Skip to content

trilltino/link-ide-extension

Repository files navigation

Link IDE Extension

A VS Code extension for peer-to-peer collaborative development using the Braid protocol over Iroh networking.

Overview

Link IDE enables real-time collaboration between developers through:

  • P2P Chat: Gossip-based messaging with persistent history
  • File Sharing: Content-addressed file transfer using bitswap protocol
  • Audio Calls: WebRTC-based voice communication (infrastructure ready)
  • Resource Sync: Braid-HTTP protocol for CRDT-based state synchronization

Architecture

The project consists of three main components:

link_ide_extension/
├── src/                      # TypeScript VS Code extension
├── braid-http-rs/           # Braid protocol implementation
├── braid-iroh-lib/          # P2P networking and file transfer library
└── braid-iroh-cli/          # Rust CLI sidecar

Component Interaction

  1. VS Code Extension (TypeScript)

    • Provides UI (webview panels, tree views, commands)
    • Manages extension lifecycle
    • Communicates with Rust CLI via JSON-RPC over stdin/stdout
  2. Braid-Iroh CLI (Rust)

    • Sidecar binary spawned by the extension
    • Handles P2P networking through Iroh
    • Processes JSON-RPC commands from TypeScript
  3. Braid-Iroh Library (Rust)

    • Core P2P functionality
    • File chunking, storage, and transfer
    • Braid protocol implementation
  4. Braid-HTTP Library (Rust)

    • Braid protocol primitives
    • Update/Patch handling
    • Version vector management

Quick Start

Development

# Install dependencies
npm install

# Build Rust CLI
npm run build:rust

# Start TypeScript watcher
npm run watch

In VS Code:

  1. Press F5 to launch extension development host
  2. Run "Link IDE: Setup" command to initialize
  3. Share your Node ID with peers

Building

# Full build
npm run compile
npm run build:rust

# Package extension
vsce package

Project Structure

src/
├── extension.ts           # Extension entry point
├── setupWebview.ts        # Setup UI (dark/light theme)
├── sidecar.ts            # CLI process management
├── treeProviders.ts      # File tree and peer list
└── collaboration/        # Chat and session management
    ├── chat.ts           # Braid-based chat implementation
    └── session.ts        # Session state management

Key Features

P2P File Transfer

Files are chunked using FastCDC algorithm, hashed with Blake3, and organized into Merkle trees. Content is addressed by CID (Content Identifier) and can be:

  • Stored locally (memory or filesystem)
  • Announced to the network via gossip
  • Fetched from peers using bitswap protocol

Chat System

Uses Braid resource subscription on /chat topic:

  • Messages synchronized via periodic merge (2s interval)
  • Deduplication by message ID
  • History available for late joiners

Identity

Each session generates a random Ed25519 keypair:

  • Node ID displayed as first 5 characters + "..."
  • New identity on each login (not persisted)
  • Logout reloads window to splash screen

Configuration

The extension stores state in VS Code's global storage:

  • nodeId: Current node identifier
  • nodeName: Display name for the node

Dependencies

  • Iroh 0.96.1: P2P QUIC networking with NAT hole punching
  • Iroh-Gossip 0.96: Topic-based pub/sub for chat and announcements
  • Blake3: Content hashing
  • FastCDC: Content-defined chunking

License

MIT OR Apache-2.0

About

A VS Code extension for peer-to-peer collaborative development using Braid over Iroh.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors