/** * Real-Time Collaboration WebSocket Server * KILLER FEATURE: Multi-developer + AI agent pair programming * Cursor doesn't have real-time collaboration - we do! */ import { EventEmitter } from 'events'; export interface CollaborationUser { id: string; name: string; email: string; avatar?: string; role: 'developer' | 'ai-agent'; capabilities?: string[]; cursor?: { line: number; column: number; file: string; }; isActive: boolean; lastSeen: Date; } export interface CollaborationSession { id: string; name: string; projectPath: string; createdAt: Date; createdBy: string; users: Map; aiAgents: Map; settings: { allowAIAgents: boolean; maxUsers: number; codeReviewMode: boolean; voiceChatEnabled: boolean; autoSave: boolean; }; metadata: { framework?: string; language: string; description: string; tags: string[]; }; } export interface CollaborationEvent { type: 'user-join' | 'user-leave' | 'code-change' | 'cursor-move' | 'ai-suggestion' | 'voice-data' | 'chat-message'; sessionId: string; userId: string; timestamp: Date; data: any; } export interface CodeChange { id: string; file: string; changes: { from: { line: number; column: number; }; to: { line: number; column: number; }; text: string; operation: 'insert' | 'delete' | 'replace'; }[]; author: string; timestamp: Date; conflictResolution?: { strategy: 'merge' | 'overwrite' | 'manual'; resolvedBy?: string; }; } export interface AISuggestion { id: string; type: 'code-completion' | 'refactoring' | 'bug-fix' | 'optimization' | 'security-fix'; file: string; position: { line: number; column: number; }; suggestion: string; explanation: string; confidence: number; agentId: string; agentName: string; accepted?: boolean; acceptedBy?: string; } export declare class CollaborationServer extends EventEmitter { private wss; private server; private sessions; private userSessions; private connections; private port; constructor(port: number); private setupServer; private handleConnection; private handleMessage; private handleJoinSession; private handleLeaveSession; private handleCreateSession; private handleCodeChange; private handleCursorMove; private handleAIRequest; private handleVoiceData; private handleChatMessage; private handleHeartbeat; private handleDisconnection; private removeUserFromSession; private getUserSession; private broadcastToSession; private send; private sendError; private resolveConflicts; private recentChanges; private getRecentChanges; private applyOperationalTransform; private transformChangeAgainstChange; private serializeSession; createSession(sessionData: Partial): string; getSession(sessionId: string): CollaborationSession | null; getAllSessions(): CollaborationSession[]; addAIAgent(sessionId: string, agent: Partial): boolean; removeAIAgent(sessionId: string, agentId: string): boolean; sendAISuggestion(sessionId: string, suggestion: AISuggestion): void; getActiveUsers(sessionId: string): CollaborationUser[]; shutdown(): Promise; } //# sourceMappingURL=websocket-server.d.ts.map