dx-forge 0.1.3

Production-ready VCS and orchestration engine for DX tools with Git-like versioning, dual-watcher architecture, traffic branch system, and component injection
Documentation
use serde::{Deserialize, Serialize};

use crate::crdt::Operation;

/// Wire format for sync messages exchanged over WebSockets.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum SyncMessage {
    Handshake { actor_id: String, repo_id: String },
    Operation { operation: Operation },
}

impl SyncMessage {
    pub fn handshake(actor_id: String, repo_id: String) -> Self {
        Self::Handshake { actor_id, repo_id }
    }

    pub fn operation(operation: Operation) -> Self {
        Self::Operation { operation }
    }
}