PeerSync Dev Connect
A cross-IDE developer collaboration extension for real-time peer communication with AI-powered message validation.

Overview
PeerSync Dev Connect enables frontend and backend developers to:
- Authenticate securely with the PeerSync network
- Discover available peers in your organization
- Connect with team members directly from your IDE
- Chat in real-time with AI-powered message validation
- Insert messages into IDE AI chat (Copilot, Cursor AI, etc.)
- Capture AI responses and send them back to peers automatically
Features
Core Features
- 🔐 Secure Authentication - JWT-based authentication with automatic token refresh
- 👥 Peer Discovery - Find and connect with team members
- 💬 Real-time Chat - Message peers directly from your IDE
- 🤖 AI Validation - Automatic security scanning and prompt improvement
- 🔗 IDE AI Integration - Insert prompts to Copilot/Cursor AI and capture responses
Security Features
- Input sanitization and validation
- Secrets and PII detection
- Injection attack prevention
- Secure token storage
Installation
From VS Code Marketplace
- Open VS Code/Cursor/Windsurf
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "PeerSync Dev Connect"
- Click Install
From VSIX
code --install-extension peersync-dev-connect-0.1.0.vsix
From Source
# Clone the repository
git clone https://github.com/peersync/dev-connect.git
cd peer-sync-extension
# Install dependencies
npm install
# Build
npm run compile
# Package
npm run package
Setup
1. Build the Extension
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Or watch for changes during development
npm run watch
Open VS Code settings and configure:
{
"peerSync.serverUrl": "https://api-peersync.up.railway.app",
"peerSync.autoConnect": false,
"peerSync.enableAiValidation": true,
"peerSync.logLevel": "info"
}
3. Sign In
- Open the PeerSync sidebar (click the icon in the Activity Bar)
- Click "Sign In to Get Started"
- Enter your credentials
Usage
Commands
| Command |
Description |
PeerSync: Connect to Peer |
Connect to the peer network or a specific peer |
PeerSync: Open Dashboard |
Open the main dashboard |
PeerSync: Open Chat |
Open chat with a peer |
PeerSync: Send Message |
Send a message to a connected peer |
Access commands via:
- Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- PeerSync sidebar buttons
- Keyboard shortcuts (configurable)
Dashboard
The dashboard shows:
- Your profile and connection status
- List of connected peers
- Recent chat messages
- Quick actions
Chat
The chat interface supports:
- Text messages - Regular text communication
- Code snippets - Share code with syntax highlighting
- AI prompts - Send prompts for the peer's AI assistant
- AI responses - Capture and share AI-generated responses
AI Integration
- Send as AI Prompt: Mark a message as an AI prompt
- Insert to AI: The recipient can insert the prompt into their IDE AI
- Capture Response: Capture the AI response
- Send Back: Automatically send the response to the original sender
Development
Project Structure
peer-sync-extension/
├── .vscode/
│ ├── launch.json # Debug configurations
│ └── tasks.json # Build tasks
├── src/
│ ├── extension.ts # Main entry point
│ ├── commands/ # Command handlers
│ │ ├── connectPeer.ts
│ │ ├── openDashboard.ts
│ │ └── sendMessage.ts
│ ├── views/ # WebView providers
│ │ ├── dashboardView.ts
│ │ └── chatView.ts
│ ├── services/ # Core business logic
│ │ ├── authService.ts
│ │ ├── peerService.ts
│ │ ├── aiValidator.ts
│ │ └── messageRouter.ts
│ ├── protocols/ # Communication protocols
│ │ └── peerProtocol.ts
│ ├── models/ # Data models
│ │ └── session.ts
│ └── utils/ # Utilities
│ ├── logger.ts
│ └── constants.ts
├── package.json
├── tsconfig.json
└── README.md
Debug
- Open the project in VS Code
- Press F5 to launch the Extension Development Host
- Set breakpoints in the TypeScript files
- Use the Debug Console for logging
For Cursor debugging:
- Use the "Run Extension (Cursor)" configuration
Build
# Compile TypeScript
npm run compile
# Watch mode
npm run watch
# Lint
npm run lint
# Fix lint issues
npm run lint:fix
Package
# Create VSIX package
npm run package
This creates peersync-dev-connect-0.1.0.vsix in the project root.
Publish
# Publish to VS Code Marketplace
npm run publish
Requires a Personal Access Token from Azure DevOps.
Configuration
| Setting |
Type |
Default |
Description |
peerSync.serverUrl |
string |
https://api-peersync.up.railway.app |
PeerSync server URL |
peerSync.autoConnect |
boolean |
false |
Auto-connect on startup |
peerSync.enableAiValidation |
boolean |
true |
Enable AI validation |
peerSync.logLevel |
string |
info |
Logging level |
Architecture
Service Layer
- AuthService - Handles authentication, token management, session persistence
- PeerService - Manages peer discovery, connections, and real-time communication
- AiValidatorService - Provides AI-powered validation, sanitization, and enhancement
- MessageRouterService - Routes messages between peers with validation pipeline
Protocol
The extension uses a versioned protocol for peer communication:
- Handshake - Connection establishment with capability negotiation
- Messages - Chat, code, AI prompts, and responses
- Presence - Online status and typing indicators
Security
- JWT authentication with automatic refresh
- Secrets and PII detection in messages
- Input sanitization and injection prevention
- Secure storage using VS Code's SecretStorage API
Roadmap
Near Term
- [ ] OAuth integration (GitHub, Google, Microsoft)
- [ ] WebRTC / Gateway for P2P connections
- [ ] End-to-end encryption
- [ ] Cursor native API support
Medium Term
- [ ] File sharing between peers
- [ ] Team rooms for group collaboration
- [ ] Rich text / markdown rendering
- [ ] Code syntax highlighting in chat
Long Term
- [ ] Analytics dashboard
- [ ] Billing and premium features
- [ ] Enterprise SSO (SAML/OIDC)
- [ ] Mobile companion app (iOS/Android)
API Reference
Commands
// Connect to peer network or specific peer
vscode.commands.executeCommand('peerSync.connect', peerId?: string);
// Open dashboard
vscode.commands.executeCommand('peerSync.openDashboard');
// Open chat with peer
vscode.commands.executeCommand('peerSync.openChat', peerId: string);
// Send message
vscode.commands.executeCommand('peerSync.sendMessage', peerId: string, content: string, options?: SendMessageOptions);
Events
The extension emits events that can be subscribed to:
// Authentication events
authService.onAuthEvent((event, session) => {
// event: 'login' | 'logout' | 'refresh' | 'expired'
});
// Peer events
peerService.onPeerEvent((event, data) => {
// event: 'peer_connected' | 'peer_disconnected' | 'peer_discovered' | 'connection_request'
});
// Message events
messageRouter.onMessageEvent((event, message, metadata) => {
// event: 'message_sent' | 'message_received' | 'message_validated' | 'ai_response_received'
});
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
License
MIT License - see LICENSE for details.
Support
Built with ❤️ by the PeerSync Team