初始化

This commit is contained in:
gozeros committed 2026-09-07 18:24:55 +08:00
1 parent 34474bd5fc
commit b638b541d0
3008 files changed
+837699

No files matched your search

@@ -0,0 +1,26 @@
"""SSE / replay envelope. Wire names are camelCase; payloads stay snake_case."""
from __future__ import annotations
from typing import Any
from pydantic import BaseModel, ConfigDict, Field
from app.report_collaboration.contracts.enums import CollaborationEventType
class CollaborationEventEnvelope(BaseModel):
"""Durable event envelope consumed by the frontend reducer."""
model_config = ConfigDict(extra="forbid", populate_by_name=True)
event_id: str = Field(alias="eventId")
session_id: str = Field(alias="sessionId")
run_id: str | None = Field(default=None, alias="runId")
seq: int = Field(ge=1)
type: CollaborationEventType
timestamp: str
data: dict[str, Any] = Field(default_factory=dict)
def to_sse_dict(self) -> dict[str, Any]:
return self.model_dump(by_alias=True, exclude_none=False)