A cross-IDE developer collaboration extension for real-time peer communication with AI-powered message validation.
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
- 🔐 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
- Input sanitization and validation
- Secrets and PII detection
- Injection attack prevention
- Secure token storage
- Open VS Code/Cursor/Windsurf
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "PeerSync Dev Connect"
- Click Install
code --install-extension peersync-dev-connect-0.1.0.vsix# 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# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Or watch for changes during development
npm run watchOpen VS Code settings and configure:
{
"peerSync.serverUrl": "https://api-peersync.up.railway.app",
"peerSync.autoConnect": false,
"peerSync.enableAiValidation": true,
"peerSync.logLevel": "info"
}- Open the PeerSync sidebar (click the icon in the Activity Bar)
- Click "Sign In to Get Started"
- Enter your credentials
| 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)
The dashboard shows:
- Your profile and connection status
- List of connected peers
- Recent chat messages
- Quick actions
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
- 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
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
- 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
# Compile TypeScript
npm run compile
# Watch mode
npm run watch
# Lint
npm run lint
# Fix lint issues
npm run lint:fix# Create VSIX package
npm run packageThis creates peersync-dev-connect-0.1.0.vsix in the project root.
# Publish to VS Code Marketplace
npm run publishRequires a Personal Access Token from Azure DevOps.
| 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 |
- 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
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
- JWT authentication with automatic refresh
- Secrets and PII detection in messages
- Input sanitization and injection prevention
- Secure storage using VS Code's SecretStorage API
- OAuth integration (GitHub, Google, Microsoft)
- WebRTC / Gateway for P2P connections
- End-to-end encryption
- Cursor native API support
- File sharing between peers
- Team rooms for group collaboration
- Rich text / markdown rendering
- Code syntax highlighting in chat
- Analytics dashboard
- Billing and premium features
- Enterprise SSO (SAML/OIDC)
- Mobile companion app (iOS/Android)
// 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);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'
});- 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
MIT License - see LICENSE for details.
Built with ❤️ by the PeerSync Team