sequenceDiagram
    participant Agent as AI Agent (DAP Client)
    participant Proxy as dapz Proxy
    participant Server as DAP Server

    rect rgb(240, 248, 255)
        Note over Agent,Server: Phase 1: Initialize
        Agent->>Proxy: initialize request
        Proxy->>Server: forward (unmodified)
        Server-->>Proxy: initialize response (capabilities)
        Proxy-->>Agent: forward (unmodified)
    end

    rect rgb(240, 255, 240)
        Note over Agent,Server: Phase 2: Launch/Attach
        Agent->>Proxy: launch / attach request
        Proxy->>Server: forward
        Server-->>Proxy: response
        Proxy-->>Agent: forward
    end

    rect rgb(255, 248, 220)
        Note over Agent,Server: Phase 3: Configuration
        Agent->>Proxy: configurationDone request
        Proxy->>Server: forward
        Server-->>Proxy: response
        Proxy-->>Agent: forward
    end

    rect rgb(255, 240, 245)
        Note over Agent,Server: Phase 4: Debug Session
        Server-->>Proxy: output event (raw)
        Note over Proxy: Interceptor: compress output
        Proxy-->>Agent: output (compressed)

        Agent->>Proxy: stackTrace request
        Proxy->>Server: forward
        Server-->>Proxy: stackTrace response (raw)
        Note over Proxy: Interceptor: compress stacktrace
        Proxy-->>Agent: stackTrace (compressed)
    end

    rect rgb(245, 240, 255)
        Note over Agent,Server: Phase 5: Disconnect
        Agent->>Proxy: disconnect request
        Proxy->>Server: forward
        Server-->>Proxy: disconnect response
        Proxy-->>Agent: forward
    end
